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.
BUSNAME_REGEX, CONNID_REGEX, DOLLAR_PATTERN, FLOAT_SUPPORT, MAX_ARRAY_LENGTH, MAX_NAME_LENGTH, OBJECT_REGEX| Constructor and Description |
|---|
DirectConnection(String address)
Create a direct connection to another application.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addGenericSigHandler(DBusMatchRule rule,
DBusSigHandler<DBusSignal> handler) |
protected <T extends DBusSignal> |
addSigHandler(DBusMatchRule rule,
DBusSigHandler<T> handler) |
static String |
createDynamicSession()
Creates a bus address for a randomly generated abstract unix socket.
|
static String |
createDynamicTCPSession()
Creates a bus address for a randomly generated tcp port.
|
DBusInterface |
getExportedObject(String source,
String path) |
String |
getMachineId() |
DBusInterface |
getRemoteObject(String objectpath)
Return a reference to a remote object.
|
<T extends DBusInterface> |
getRemoteObject(String objectpath,
Class<T> type)
Return a reference to a remote object.
|
void |
listen()
Use this method when running on server side.
|
protected void |
removeGenericSigHandler(DBusMatchRule rule,
DBusSigHandler<DBusSignal> handler) |
protected <T extends DBusSignal> |
removeSigHandler(DBusMatchRule rule,
DBusSigHandler<T> handler) |
addFallback, addSigHandler, addSigHandler, addSigHandlerWithoutMatch, callMethodAsync, callWithCallback, changeThreadCount, close, disconnect, exportObject, getAddress, getCallInfo, getError, getExportedObject, getExportedObjects, getGenericHandledSignals, getHandledSignals, getImportedObjects, getObjectTree, getPendingCalls, getPendingErrorQueue, handleException, isConnected, queueCallback, removeFallback, removeSigHandler, removeSigHandler, sendMessage, setWeakReferences, unExportObjectpublic DirectConnection(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 - on errorpublic void listen()
listen in class AbstractConnectionpublic static String createDynamicTCPSession()
public static String createDynamicSession()
public DBusInterface getRemoteObject(String objectpath) throws DBusException
objectpath - The path on which the process is exporting the object.ClassCastException - If type is not a sub-type of DBusInterfaceDBusException - If busname or objectpath are incorrectly formatted.public <T extends DBusInterface> T getRemoteObject(String objectpath, Class<T> type) throws DBusException
T - class which extends DBusInterfaceobjectpath - 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.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 AbstractConnectionDBusExceptionprotected <T extends DBusSignal> void addSigHandler(DBusMatchRule rule, DBusSigHandler<T> handler) throws DBusException
addSigHandler in class AbstractConnectionDBusExceptionprotected void removeGenericSigHandler(DBusMatchRule rule, DBusSigHandler<DBusSignal> handler) throws DBusException
removeGenericSigHandler in class AbstractConnectionDBusExceptionprotected void addGenericSigHandler(DBusMatchRule rule, DBusSigHandler<DBusSignal> handler) throws DBusException
addGenericSigHandler in class AbstractConnectionDBusExceptionpublic DBusInterface getExportedObject(String source, String path) throws DBusException
getExportedObject in class AbstractConnectionDBusExceptionpublic String getMachineId()
getMachineId in class AbstractConnectionCopyright © 2020. All rights reserved.