Top Description Methods
org.freedesktop.dbus.connections.impl

public sealed Interface IRemoteObjectGetter

Known Direct Implementers
org.freedesktop.dbus.connections.impl.DBusConnection
Imports
org.freedesktop.dbus.DBusPath, org.freedesktop.dbus.exceptions.DBusException, .InvalidBusNameException, .InvalidObjectPathException, org.freedesktop.dbus.interfaces.DBusInterface, org.freedesktop.dbus.utils.DBusObjects

Interface which contains all methods to retrieve any object from DBus.
Since
5.1.1 - 2024-11-16

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

String or null
getDBusOwnerName
(String
bus name
_busName
)

Returns name of the current owning dbus session.

public default <I extends DBusInterface> I
getPeerRemoteObject(String _busname, String _objectpath, Class<I> _type)

public default <I extends DBusInterface> I
getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type)

public DBusInterface

Returns:

A reference to a remote object.
getPeerRemoteObject
(String
The bus name to connect to. Usually a well known bus name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
_busname
,
String
The path on which the process is exporting the object.$
_objectpath
)

Return a reference to a remote object.

public default <
class extending DBusInterface
I extends DBusInterface
>
I

Returns:

A reference to a remote object.
getPeerRemoteObject
(String
The bus name to connect to. Usually a well known bus name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
_busname
,
String
The path on which the process is exporting the object.$
_objectpath
,
Class<I>
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.
_type
,
boolean
Disable/Enable auto-starting of services in response to calls on this object. Default is enabled; when calling a method with auto-start enabled, if the destination is a well-known name and is not owned the bus will attempt to start a process to take the name. When disabled an error is returned immediately.
_autostart
)

Return a reference to a remote object.

public default <I extends DBusInterface> I
getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart)

public DBusInterface

Returns:

A reference to a remote object.
getRemoteObject
(String
The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
_busname
,
String
The path on which the process is exporting the object.
_objectpath
)

Return a reference to a remote object.

public default DBusInterface
getRemoteObject(String _busname, DBusPath _objectpath)

public default <
class extending DBusInterface
I extends DBusInterface
>
I

Returns:

A reference to a remote object.
getRemoteObject
(String
The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
_busname
,
String
The path on which the process is exporting the object.
_objectpath
,
Class<I>
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.
_type
)

Return a reference to a remote object.

public default <I extends DBusInterface> I
getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type)

public <
class extending DBusInterface
I extends DBusInterface
>
I

Returns:

A reference to a remote object.
getRemoteObject
(String
The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".
_busname
,
String
The path on which the process is exporting the object.
_objectpath
,
Class<I>
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.
_type
,
boolean
Disable/Enable auto-starting of services in response to calls on this object. Default is enabled; when calling a method with auto-start enabled, if the destination is a well-known name and is not owned the bus will attempt to start a process to take the name. When disabled an error is returned immediately.
_autostart
)

Return a reference to a remote object.

public default <I extends DBusInterface> I
getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart)

Method Detail

getDBusOwnerNameback to summary
public String getDBusOwnerName(String _busName)

Returns name of the current owning dbus session.

Parameters
_busName:String

bus name

Returns:String

String or null

getPeerRemoteObjectback to summary
public default <I extends DBusInterface> I getPeerRemoteObject(String _busname, String _objectpath, Class<I> _type) throws DBusException
getPeerRemoteObjectback to summary
public default <I extends DBusInterface> I getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type) throws DBusException
getPeerRemoteObjectback to summary
public DBusInterface getPeerRemoteObject(String _busname, String _objectpath) throws InvalidBusNameException, DBusException

Return a reference to a remote object. This method will resolve the well known name (if given) to a unique bus name when you call it. This means that if a well known name is released by one process and acquired by another calls to objects gained from this method will continue to operate on the original process. This method will use bus introspection to determine the interfaces on a remote object and so may block and may fail. The resulting proxy object will, however, be castable to any interface it implements. It will also autostart the process if applicable. Also note that the resulting proxy may fail to execute the correct method with overloaded methods and that complex types may fail in interesting ways. Basically, if something odd happens, try specifying the interface explicitly.

Parameters
_busname:String

The bus name to connect to. Usually a well known bus name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".

_objectpath:String

The path on which the process is exporting the object.$

Returns:DBusInterface

A reference to a remote object.

Exceptions
DBusException:
on any other errors
MissingInterfaceImplementationException:
If type is not a sub-type of DBusInterface
InvalidObjectPathException:
When object path is invalid
ClassOutsideOfPackageException:
When given type class has not package
getPeerRemoteObjectback to summary
public default <I extends DBusInterface> I getPeerRemoteObject(String _busname, String _objectpath, Class<I> _type, boolean _autostart) throws DBusException

Return a reference to a remote object. This method will resolve the well known name (if given) to a unique bus name when you call it. This means that if a well known name is released by one process and acquired by another calls to objects gained from this method will continue to operate on the original process.

Parameters
<I>
class extending DBusInterface
_busname:String

The bus name to connect to. Usually a well known bus name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".

_objectpath:String

The path on which the process is exporting the object.$

_type:Class<I>

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.

_autostart:boolean

Disable/Enable auto-starting of services in response to calls on this object. Default is enabled; when calling a method with auto-start enabled, if the destination is a well-known name and is not owned the bus will attempt to start a process to take the name. When disabled an error is returned immediately.

Returns:I

A reference to a remote object.

Exceptions
DBusException:
on any other errors
MissingInterfaceImplementationException:
If type is not a sub-type of DBusInterface
InvalidObjectPathException:
When object path is invalid
ClassOutsideOfPackageException:
When given type class has not package
getPeerRemoteObjectback to summary
public default <I extends DBusInterface> I getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart) throws DBusException
See Also
getPeerRemoteObject(String, String, Class, boolean)
getRemoteObjectback to summary
public DBusInterface getRemoteObject(String _busname, String _objectpath) throws DBusException, InvalidBusNameException, InvalidObjectPathException

Return a reference to a remote object. This method will always refer to the well known name (if given) rather than resolving it to a unique bus name. In particular this means that if a process providing the well known name disappears and is taken over by another process proxy objects gained by this method will make calls on the new proccess. This method will use bus introspection to determine the interfaces on a remote object and so may block and may fail. The resulting proxy object will, however, be castable to any interface it implements. It will also autostart the process if applicable. Also note that the resulting proxy may fail to execute the correct method with overloaded methods and that complex types may fail in interesting ways. Basically, if something odd happens, try specifying the interface explicitly.

Parameters
_busname:String

The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".

_objectpath:String

The path on which the process is exporting the object.

Returns:DBusInterface

A reference to a remote object.

Exceptions
DBusException:
If remote object cannot be retrieved
InvalidBusNameException:
If busname is incorrectly formatted
InvalidObjectPathException:
If objectpath is incorrectly formatted
MissingInterfaceImplementationException:
If type is not a sub-type of DBusInterface
getRemoteObjectback to summary
public default DBusInterface getRemoteObject(String _busname, DBusPath _objectpath) throws DBusException, InvalidBusNameException, InvalidObjectPathException
See Also
getRemoteObject(String, String)
getRemoteObjectback to summary
public default <I extends DBusInterface> I getRemoteObject(String _busname, String _objectpath, Class<I> _type) throws DBusException

Return a reference to a remote object. This method will always refer to the well known name (if given) rather than resolving it to a unique bus name. In particular this means that if a process providing the well known name disappears and is taken over by another process proxy objects gained by this method will make calls on the new proccess.

Parameters
<I>
class extending DBusInterface
_busname:String

The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".

_objectpath:String

The path on which the process is exporting the object.

_type:Class<I>

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.

Returns:I

A reference to a remote object.

Exceptions
DBusException:
on any other errors
MissingInterfaceImplementationException:
If type is not a sub-type of DBusInterface
InvalidObjectPathException:
When object path is invalid
ClassOutsideOfPackageException:
When given type class has not package
getRemoteObjectback to summary
public default <I extends DBusInterface> I getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type) throws DBusException
See Also
getRemoteObject(String, String, Class)
getRemoteObjectback to summary
public <I extends DBusInterface> I getRemoteObject(String _busname, String _objectpath, Class<I> _type, boolean _autostart) throws DBusException

Return a reference to a remote object. This method will always refer to the well known name (if given) rather than resolving it to a unique bus name. In particular this means that if a process providing the well known name disappears and is taken over by another process proxy objects gained by this method will make calls on the new process.

Parameters
<I>
class extending DBusInterface
_busname:String

The bus name to connect to. Usually a well known bus name name in dot-notation (such as "org.freedesktop.local") or may be a DBus address such as ":1-16".

_objectpath:String

The path on which the process is exporting the object.

_type:Class<I>

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.

_autostart:boolean

Disable/Enable auto-starting of services in response to calls on this object. Default is enabled; when calling a method with auto-start enabled, if the destination is a well-known name and is not owned the bus will attempt to start a process to take the name. When disabled an error is returned immediately.

Returns:I

A reference to a remote object.

Exceptions
DBusException:
on any other errors
MissingInterfaceImplementationException:
If type is not a sub-type of DBusInterface
InvalidObjectPathException:
When object path is invalid
ClassOutsideOfPackageException:
When given type class has not package
getRemoteObjectback to summary
public default <I extends DBusInterface> I getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart) throws DBusException
See Also
getRemoteObject(String, String, Class, boolean)