Interface IRemoteObjectGetter

All Known Implementing Classes:
DBusConnection

public sealed interface IRemoteObjectGetter permits DBusConnection
Interface which contains all methods to retrieve any object from DBus.
Since:
5.1.1 - 2024-11-16
  • Method Details

    • getPeerRemoteObject

      default <I extends DBusInterface> I getPeerRemoteObject(String _busname, String _objectpath, Class<I> _type) throws DBusException
      Throws:
      DBusException
    • getPeerRemoteObject

      default <I extends DBusInterface> I getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type) throws DBusException
      Throws:
      DBusException
    • getPeerRemoteObject

      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 - 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 - The path on which the process is exporting the object.$
      Returns:
      A reference to a remote object.
      Throws:
      MissingInterfaceImplementationException - If type is not a sub-type of DBusInterface
      InvalidObjectPathException - When object path is invalid
      ClassOutsideOfPackageException - When given type class has not package
      DBusException - on any other errors
      InvalidBusNameException
    • getRemoteObject

      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 - 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 - The path on which the process is exporting the object.
      Returns:
      A reference to a remote object.
      Throws:
      MissingInterfaceImplementationException - If type is not a sub-type of DBusInterface
      DBusException - If remote object cannot be retrieved
      InvalidBusNameException - If busname is incorrectly formatted
      InvalidObjectPathException - If objectpath is incorrectly formatted
    • getRemoteObject

    • getPeerRemoteObject

      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.
      Type Parameters:
      I - class extending DBusInterface
      Parameters:
      _busname - 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 - 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.
      _autostart - 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:
      A reference to a remote object.
      Throws:
      MissingInterfaceImplementationException - If type is not a sub-type of DBusInterface
      InvalidObjectPathException - When object path is invalid
      ClassOutsideOfPackageException - When given type class has not package
      DBusException - on any other errors
    • getPeerRemoteObject

      default <I extends DBusInterface> I getPeerRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart) throws DBusException
      Throws:
      DBusException
      See Also:
    • getRemoteObject

      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.
      Type Parameters:
      I - class extending DBusInterface
      Parameters:
      _busname - 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 - 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.
      Returns:
      A reference to a remote object.
      Throws:
      MissingInterfaceImplementationException - If type is not a sub-type of DBusInterface
      InvalidObjectPathException - When object path is invalid
      ClassOutsideOfPackageException - When given type class has not package
      DBusException - on any other errors
    • getRemoteObject

      default <I extends DBusInterface> I getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type) throws DBusException
      Throws:
      DBusException
      See Also:
    • getRemoteObject

      <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.
      Type Parameters:
      I - class extending DBusInterface
      Parameters:
      _busname - 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 - 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.
      _autostart - 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:
      A reference to a remote object.
      Throws:
      MissingInterfaceImplementationException - If type is not a sub-type of DBusInterface
      InvalidObjectPathException - When object path is invalid
      ClassOutsideOfPackageException - When given type class has not package
      DBusException - on any other errors
    • getRemoteObject

      default <I extends DBusInterface> I getRemoteObject(String _busname, DBusPath _objectpath, Class<I> _type, boolean _autostart) throws DBusException
      Throws:
      DBusException
      See Also:
    • getDBusOwnerName

      String getDBusOwnerName(String _busName)
      Returns name of the current owning dbus session.
      Parameters:
      _busName - bus name
      Returns:
      String or null