1.21 <GDBusObjectManagerServer>

Class: <GDBusObjectManagerServer>

It derives from <GObject>.

<GDBusObjectManagerServer> is used to export <GDBusObject> 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 <GDBusObjectManagerClient> 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.

Properties

Property: dbus-object-manager-server:connection self

The <GDBusConnection> to export objects on.

Its value is a <GDBusConnection>, or #f.

Set it with (set! (dbus-object-manager-server:connection self) value).

Property: dbus-object-manager-server:object-path self

The object path to register the manager object at.

Its value is a string, or #f.

It can only be set when the object is made, with #:object-path.

Procedures

Method: dbus-object-manager-server:export self object

Exports object on self.

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 self.

Note that self will take a reference on object for as long as it is exported.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>.

object

Passed: a <GDBusObjectSkeleton>.

A <GDBusObjectSkeleton>.

Method: dbus-object-manager-server:export-uniquely self object
Method: export-uniquely self object

Like dbus-object-manager-server:export but appends a string of the form _N (with N being a natural number) to object’s object path if an object with the given path already exists. As such, the dbus-object-proxy:g-object-path property of object may be modified.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>.

object

Passed: a <GDBusObjectSkeleton>.

An object.

Method: dbus-object-manager-server:get-connection self ⇒ %return
Method: get-connection self ⇒ %return

Gets the <GDBusConnection> used by self.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>

%return

Returned: a <GDBusConnection>, or #f.

A <GDBusConnection> object or #f if self isn’t exported on a connection. The returned object should be freed with object:unref.

Method: dbus-object-manager-server:is-exported? self object ⇒ %return
Method: is-exported? self object ⇒ %return

Returns whether object is currently exported on self.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>.

object

Passed: a <GDBusObjectSkeleton>.

An object.

%return

Returned: a boolean.

#t if object is exported

Procedure: dbus-object-manager-server:new object-path ⇒ %return

Creates a new <GDBusObjectManagerServer> object.

The returned server isn’t yet exported on any connection. To do so, use dbus-object-manager-server:set-connection. Normally you want to export all of your objects before doing so to avoid InterfacesAdded signals being emitted.

object-path

Passed: a string.

The object path to export the manager object at.

%return

Returned: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer> object. Free with object:unref.

Method: dbus-object-manager-server:set-connection self [connection]
Method: set-connection self [connection]

Exports all objects managed by self on connection. If connection is #f, stops exporting objects.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>.

connection

Passed, or left out: a <GDBusConnection>, or #f.

A <GDBusConnection> or #f.

Method: dbus-object-manager-server:unexport? self object-path ⇒ %return
Method: unexport? self object-path ⇒ %return

If self has an object at path, removes the object. Otherwise does nothing.

Note that object-path must be in the hierarchy rooted by the object path for self.

self

Passed: a <GDBusObjectManagerServer>.

A <GDBusObjectManagerServer>.

object-path

Passed: a string.

An object path.

%return

Returned: a boolean.

#t if object at object-path was removed, #f otherwise.