public class DirectConnection extends AbstractConnection
Signal Handlers and method calls from remote objects are run in their own threads, you MUST handle the concurrency issues.
AbstractConnection._thread, AbstractConnection._workerthread, AbstractConnection.FallbackContainer
_run, addr, connected, EXCEPTION_DEBUG, exportedObjects, fallbackcontainer, handledSignals, importedObjects, pendingCallbackReplys, pendingCallbacks, pendingCalls, runnables, sender, thread, TIMEOUT, transport, weakreferences, workers
Constructor | Description |
---|---|
DirectConnection(java.lang.String address) |
Create a direct connection to another application.
|
Modifier and Type | Method | Description |
---|---|---|
protected <T extends DBusSignal> |
addSigHandler(DBusMatchRule rule,
DBusSigHandler<T> handler) |
|
static java.lang.String |
createDynamicSession() |
Creates a bus address for a randomly generated abstract unix socket.
|
static java.lang.String |
createDynamicTCPSession() |
Creates a bus address for a randomly generated tcp port.
|
DBusInterface |
getRemoteObject(java.lang.String objectpath) |
Return a reference to a remote object.
|
DBusInterface |
getRemoteObject(java.lang.String objectpath,
java.lang.Class<? extends DBusInterface> type) |
Return a reference to a remote object.
|
protected <T extends DBusSignal> |
removeSigHandler(DBusMatchRule rule,
DBusSigHandler<T> handler) |
addFallback, addSigHandler, addSigHandler, addSigHandlerWithoutMatch, callMethodAsync, callWithCallback, changeThreadCount, disconnect, exportObject, finalize, getAddress, getCallInfo, getError, listen, removeFallback, removeSigHandler, removeSigHandler, sendMessage, sendSignal, setWeakReferences, unExportObject
public DirectConnection(java.lang.String address) throws DBusException
address
- The address to connect to. This is a standard D-Bus address, except that the additional parameter 'listen=true' should be added in the application which is creating the socket.DBusException
public static java.lang.String createDynamicTCPSession()
public static java.lang.String createDynamicSession()
public DBusInterface getRemoteObject(java.lang.String objectpath) throws DBusException
objectpath
- The path on which the process is exporting the object.java.lang.ClassCastException
- If type is not a sub-type of DBusInterfaceDBusException
- If busname or objectpath are incorrectly formatted.public DBusInterface getRemoteObject(java.lang.String objectpath, java.lang.Class<? extends DBusInterface> type) throws DBusException
objectpath
- The path on which the process is exporting the object.type
- The interface they are exporting it on. This type must have the same full class name and exposed method signatures
as the interface the remote object is exporting.java.lang.ClassCastException
- If type is not a sub-type of DBusInterfaceDBusException
- If busname or objectpath are incorrectly formatted or type is not in a package.protected <T extends DBusSignal> void removeSigHandler(DBusMatchRule rule, DBusSigHandler<T> handler) throws DBusException
removeSigHandler
in class AbstractConnection
DBusException
protected <T extends DBusSignal> void addSigHandler(DBusMatchRule rule, DBusSigHandler<T> handler) throws DBusException
addSigHandler
in class AbstractConnection
DBusException