Class DBusObjectManagerServer
- All Implemented Interfaces:
Proxy
,DBusObjectManager
GDBusObjectManagerServer
is used to export DBusObject
instances
using the standardized
org.freedesktop.DBus.ObjectManager
interface. For example, remote D-Bus clients can get all objects
and properties in a single call. Additionally, any change in the
object hierarchy is broadcast using signals. This means that D-Bus
clients can keep caches up to date by only listening to D-Bus
signals.
The recommended path to export an object manager at is the path form of the
well-known name of a D-Bus service, or below. For example, if a D-Bus service
is available at the well-known name net.example.ExampleService1
, the object
manager should typically be exported at /net/example/ExampleService1
, or
below (to allow for multiple object managers in a service).
It is supported, but not recommended, to export an object manager at the root
path, /
.
See DBusObjectManagerClient
for the client-side code that is
intended to be used with GDBusObjectManagerServer
or any D-Bus
object implementing the org.freedesktop.DBus.ObjectManager
interface.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class implementing a builder pattern to construct a GObject with properties.static class
Class structure forGDBusObjectManagerServer
.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.DBusObjectManager
DBusObjectManager.DBusObjectManagerIface, DBusObjectManager.DBusObjectManagerImpl, DBusObjectManager.InterfaceAddedCallback, DBusObjectManager.InterfaceRemovedCallback, DBusObjectManager.ObjectAddedCallback, DBusObjectManager.ObjectRemovedCallback
-
Constructor Summary
ConstructorDescriptionDBusObjectManagerServer
(MemorySegment address) Create a DBusObjectManagerServer proxy instance for the provided memory address.DBusObjectManagerServer
(String objectPath) Creates a newGDBusObjectManagerServer
object. -
Method Summary
Modifier and TypeMethodDescriptionprotected DBusObjectManagerServer
asParent()
Returns this instance as if it were its parent type.static DBusObjectManagerServer.Builder
<? extends DBusObjectManagerServer.Builder> builder()
ADBusObjectManagerServer.Builder
object constructs aDBusObjectManagerServer
with the specified properties.void
export
(DBusObjectSkeleton object) Exportsobject
on this DBusObjectManagerServer.void
exportUniquely
(DBusObjectSkeleton object) Like g_dbus_object_manager_server_export() but appends a string of the form _N (with N being a natural number) toobject
's object path if an object with the given path already exists.Gets theGDBusConnection
used by this DBusObjectManagerServer.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the DBusObjectManagerServer classboolean
isExported
(DBusObjectSkeleton object) Returns whetherobject
is currently exported on this DBusObjectManagerServer.void
setConnection
(@Nullable DBusConnection connection) Exports all objects managed by this DBusObjectManagerServer onconnection
.boolean
If this DBusObjectManagerServer has an object atpath
, removes the object.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gnome.gio.DBusObjectManager
emitInterfaceAdded, emitInterfaceRemoved, emitObjectAdded, emitObjectRemoved, getInterface, getObject, getObjectPath, getObjects, onInterfaceAdded, onInterfaceRemoved, onObjectAdded, onObjectRemoved
-
Constructor Details
-
DBusObjectManagerServer
Create a DBusObjectManagerServer proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
DBusObjectManagerServer
Creates a newGDBusObjectManagerServer
object.The returned server isn't yet exported on any connection. To do so, use g_dbus_object_manager_server_set_connection(). Normally you want to export all of your objects before doing so to avoid InterfacesAdded signals being emitted.
- Parameters:
objectPath
- The object path to export the manager object at.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
export
Exportsobject
on this DBusObjectManagerServer.If there is already a
GDBusObject
exported at the object path, then the old object is removed.The object path for
object
must be in the hierarchy rooted by the object path for this DBusObjectManagerServer.Note that this DBusObjectManagerServer will take a reference on
object
for as long as it is exported.- Parameters:
object
- AGDBusObjectSkeleton
.
-
exportUniquely
Like g_dbus_object_manager_server_export() but appends a string of the form _N (with N being a natural number) toobject
's object path if an object with the given path already exists. As such, theGDBusObjectProxy
:g-object-path property ofobject
may be modified.- Parameters:
object
- An object.
-
getConnection
Gets theGDBusConnection
used by this DBusObjectManagerServer.- Returns:
- A
GDBusConnection
object ornull
if this DBusObjectManagerServer isn't exported on a connection. The returned object should be freed with g_object_unref().
-
isExported
Returns whetherobject
is currently exported on this DBusObjectManagerServer.- Parameters:
object
- An object.- Returns:
true
ifobject
is exported
-
setConnection
Exports all objects managed by this DBusObjectManagerServer onconnection
. Ifconnection
isnull
, stops exporting objects.- Parameters:
connection
- AGDBusConnection
ornull
.
-
unexport
If this DBusObjectManagerServer has an object atpath
, removes the object. Otherwise does nothing.Note that
objectPath
must be in the hierarchy rooted by the object path for this DBusObjectManagerServer.- Parameters:
objectPath
- An object path.- Returns:
true
if object atobjectPath
was removed,false
otherwise.
-
builder
ADBusObjectManagerServer.Builder
object constructs aDBusObjectManagerServer
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withDBusObjectManagerServer.Builder.build()
.
-