Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
Slightly improved version of the Java DBus library
provided by freedesktop.org (https://dbus.freedesktop.org/doc/dbus-java/).
Changes:
- Fixed lot's of Java warnings
- Fixed broken 'Gettext' feature (Exceptions on unsupported languages, usage of "_" as method name).
- Renamed some classes/methods/variables to comply with Java naming scheme.
- Removed usage of proprietary logger and replaced it with sl4fj.
- Renamed/refactored some parts to be more 'Java' like (e.g. naming, shadowing)
- Fixed problems with DbusConnection.getConnection(SESSION) when using display export (e.g. SSH X11 forward)
/*
D-Bus Java Implementation
Copyright (c) 2005-2006 Matthew Johnson
This program is free software; you can redistribute it and/or modify it
under the terms of either the GNU Lesser General Public License Version 2 or the
Academic Free Licence Version 2.1.
Full licence texts are included in the COPYING file with this program.
*/
package org.freedesktop.dbus.messages;
import java.lang.reflect.Constructor;
import java.lang.reflect.GenericDeclaration;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.freedesktop.dbus.DBusMatchRule;
import org.freedesktop.dbus.InternalSignal;
import org.freedesktop.dbus.Marshalling;
import org.freedesktop.dbus.annotations.DBusInterfaceName;
import org.freedesktop.dbus.annotations.DBusMemberName;
import org.freedesktop.dbus.connections.AbstractConnection;
import org.freedesktop.dbus.exceptions.DBusException;
import org.freedesktop.dbus.exceptions.MessageFormatException;
import org.freedesktop.dbus.interfaces.DBusInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DBusSignal extends Message {
private static final Map> CLASS_CACHE =
new ConcurrentHashMap<>();
private static final Map, Type[]> TYPE_CACHE =
new ConcurrentHashMap<>();
private static final Map, Constructor extends DBusSignal>> CONSTRUCTOR_CACHE =
new ConcurrentHashMap<>();
private static final Map SIGNAL_NAMES =
new ConcurrentHashMap<>();
private static final Map INT_NAMES =
new ConcurrentHashMap<>();
private final Logger logger =
LoggerFactory.getLogger(getClass());
private Class extends DBusSignal> clazz;
private boolean bodydone = false;
private byte[] blen;
DBusSignal() {
}
public DBusSignal(String source, String path, String iface, String member, String sig, Object... args) throws DBusException {
super(Message.Endian.BIG, Message.MessageType.SIGNAL, (byte) 0);
if (null == path || null == member || null == iface) {
throw new MessageFormatException("Must specify object path, interface and signal name to Signals.");
}
getHeaders().put(Message.HeaderField.PATH, path);
getHeaders().put(Message.HeaderField.MEMBER, member);
getHeaders().put(Message.HeaderField.INTERFACE, iface);
List