Gio.DBusObjectManagerClient¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusObjectManager (4), Gio.Initable (2)
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
Virtual Methods¶
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r |
|||
r/w/co |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when one or more D-Bus properties on proxy changes. |
|
Emitted when a D-Bus signal is received on interface_proxy. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.DBusObjectManagerClient(**kwargs)¶
- Bases:
GObject.Object
,Gio.AsyncInitable
,Gio.DBusObjectManager
,Gio.Initable
- Abstract:
No
- Structure:
GDBusObjectManagerClient
is used to create, monitor and delete object proxies for remote objects exported by a [class`Gio`.DBusObjectManagerServer] (or any code implementing the org.freedesktop.DBus.ObjectManager interface).Once an instance of this type has been created, you can connect to the [signal`Gio`.DBusObjectManager::object-added] and [signal`Gio`.DBusObjectManager::object-removed signals] and inspect the [class`Gio`.DBusObjectProxy] objects returned by [method`Gio`.DBusObjectManager.get_objects].
If the name for a
GDBusObjectManagerClient
is not owned by anyone at object construction time, the default behavior is to request the message bus to launch an owner for the name. This behavior can be disabled using theG_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START
flag. It’s also worth noting that this only works if the name of interest is activatable in the first place. E.g. in some cases it is not possible to launch an owner for the requested name. In this case,GDBusObjectManagerClient
object construction still succeeds but there will be no object proxies (e.g. [method`Gio`.DBusObjectManager.get_objects] returns the empty list) and the [property`Gio`.DBusObjectManagerClient:name-owner] property isNULL
.The owner of the requested name can come and go (for example consider a system service being restarted) –
GDBusObjectManagerClient
handles this case too; simply connect to the [signal`GObject`.Object::notify] signal to watch for changes on the [property`Gio`.DBusObjectManagerClient:name-owner] property. When the name owner vanishes, the behavior is that [property`Gio`.DBusObjectManagerClient:name-owner] is set toNULL
(this includes emission of the [signal`GObject`.Object::notify] signal) and then [signal`Gio`.DBusObjectManager::object-removed] signals are synthesized for all currently existing object proxies. Since [property`Gio`.DBusObjectManagerClient:name-owner] isNULL
when this happens, you can use this information to disambiguate a synthesized signal from a genuine signal caused by object removal on the remote [iface`Gio`.DBusObjectManager]. Similarly, when a new name owner appears, [signal`Gio`.DBusObjectManager::object-added] signals are synthesized while [property`Gio`.DBusObjectManagerClient:name-owner] is stillNULL
. Only when all object proxies have been added, the [property`Gio`.DBusObjectManagerClient:name-owner] is set to the new name owner (this includes emission of the [signal`GObject`.Object::notify] signal). Furthermore, you are guaranteed that [property`Gio`.DBusObjectManagerClient:name-owner] will alternate between a name owner (e.g.:1.42
) andNULL
even in the case where the name of interest is atomically replacedUltimately,
GDBusObjectManagerClient
is used to obtain [class`Gio`.DBusProxy] instances. All signals (including theorg.freedesktop.DBus.Properties::PropertiesChanged
signal) delivered to [class`Gio`.DBusProxy] instances are guaranteed to originate from the name owner. This guarantee along with the behavior described above, means that certain race conditions including the “half the proxy is from the old owner and the other half is from the new owner” problem cannot happen.To avoid having the application connect to signals on the returned [class`Gio`.DBusObjectProxy] and [class`Gio`.DBusProxy] objects, the [signal`Gio`.DBusObject::interface-added], [signal`Gio`.DBusObject::interface-removed], [signal`Gio`.DBusProxy::g-properties-changed] and [signal`Gio`.DBusProxy::g-signal] signals are also emitted on the
GDBusObjectManagerClient
instance managing these objects. The signals emitted are [signal`Gio`.DBusObjectManager::interface-added], [signal`Gio`.DBusObjectManager::interface-removed], [signal`Gio`.DBusObjectManagerClient::interface-proxy-properties-changed] and [signal`Gio`.DBusObjectManagerClient::interface-proxy-signal].Note that all callbacks and signals are emitted in the thread-default main context (see [method`GLib`.MainContext.push_thread_default]) that the
GDBusObjectManagerClient
object was constructed in. Additionally, the [class`Gio`.DBusObjectProxy] and [class`Gio`.DBusProxy] objects originating from theGDBusObjectManagerClient
object will be created in the same context and, consequently, will deliver signals in the same main loop.New in version 2.30.
- classmethod new(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data)[source]¶
- Parameters:
connection (
Gio.DBusConnection
) – AGio.DBusConnection
.flags (
Gio.DBusObjectManagerClientFlags
) – Zero or more flags from theGio.DBusObjectManagerClientFlags
enumeration.name (
str
) – The owner of the control object (unique or well-known name).object_path (
str
) – The object path of the control object.get_proxy_type_func (
Gio.DBusProxyTypeFunc
orNone
) – AGio.DBusProxyTypeFunc
function orNone
to always constructGio.DBusProxy
proxies.get_proxy_type_user_data (
object
orNone
) – User data to pass to get_proxy_type_func.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the request is satisfied.
Asynchronously creates a new
Gio.DBusObjectManagerClient
object.This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the
thread-default main context
of the thread you are calling this method from. You can then callGio.DBusObjectManagerClient.new_finish
() to get the result. SeeGio.DBusObjectManagerClient.new_sync
() for the synchronous version.New in version 2.30.
- classmethod new_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult
) – AGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toGio.DBusObjectManagerClient.new
().- Raises:
- Returns:
A
Gio.DBusObjectManagerClient
object orNone
if error is set. Free withGObject.Object.unref
().- Return type:
Finishes an operation started with
Gio.DBusObjectManagerClient.new
().New in version 2.30.
- classmethod new_for_bus(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable, callback, *user_data)[source]¶
- Parameters:
bus_type (
Gio.BusType
) – AGio.BusType
.flags (
Gio.DBusObjectManagerClientFlags
) – Zero or more flags from theGio.DBusObjectManagerClientFlags
enumeration.name (
str
) – The owner of the control object (unique or well-known name).object_path (
str
) – The object path of the control object.get_proxy_type_func (
Gio.DBusProxyTypeFunc
orNone
) – AGio.DBusProxyTypeFunc
function orNone
to always constructGio.DBusProxy
proxies.get_proxy_type_user_data (
object
orNone
) – User data to pass to get_proxy_type_func.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
callback (
Gio.AsyncReadyCallback
orNone
) – AGio.AsyncReadyCallback
to call when the request is satisfied.
Like
Gio.DBusObjectManagerClient.new
() but takes aGio.BusType
instead of aGio.DBusConnection
.This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the
thread-default main loop
of the thread you are calling this method from. You can then callGio.DBusObjectManagerClient.new_for_bus_finish
() to get the result. SeeGio.DBusObjectManagerClient.new_for_bus_sync
() for the synchronous version.New in version 2.30.
- classmethod new_for_bus_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult
) – AGio.AsyncResult
obtained from theGio.AsyncReadyCallback
passed toGio.DBusObjectManagerClient.new_for_bus
().- Raises:
- Returns:
A
Gio.DBusObjectManagerClient
object orNone
if error is set. Free withGObject.Object.unref
().- Return type:
Finishes an operation started with
Gio.DBusObjectManagerClient.new_for_bus
().New in version 2.30.
- classmethod new_for_bus_sync(bus_type, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable)[source]¶
- Parameters:
bus_type (
Gio.BusType
) – AGio.BusType
.flags (
Gio.DBusObjectManagerClientFlags
) – Zero or more flags from theGio.DBusObjectManagerClientFlags
enumeration.name (
str
) – The owner of the control object (unique or well-known name).object_path (
str
) – The object path of the control object.get_proxy_type_func (
Gio.DBusProxyTypeFunc
orNone
) – AGio.DBusProxyTypeFunc
function orNone
to always constructGio.DBusProxy
proxies.get_proxy_type_user_data (
object
orNone
) – User data to pass to get_proxy_type_func.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
- Raises:
- Returns:
A
Gio.DBusObjectManagerClient
object orNone
if error is set. Free withGObject.Object.unref
().- Return type:
Like
Gio.DBusObjectManagerClient.new_sync
() but takes aGio.BusType
instead of aGio.DBusConnection
.This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See
Gio.DBusObjectManagerClient.new_for_bus
() for the asynchronous version.New in version 2.30.
- classmethod new_sync(connection, flags, name, object_path, get_proxy_type_func, get_proxy_type_user_data, cancellable)[source]¶
- Parameters:
connection (
Gio.DBusConnection
) – AGio.DBusConnection
.flags (
Gio.DBusObjectManagerClientFlags
) – Zero or more flags from theGio.DBusObjectManagerClientFlags
enumeration.name (
str
orNone
) – The owner of the control object (unique or well-known name), orNone
when not using a message bus connection.object_path (
str
) – The object path of the control object.get_proxy_type_func (
Gio.DBusProxyTypeFunc
orNone
) – AGio.DBusProxyTypeFunc
function orNone
to always constructGio.DBusProxy
proxies.get_proxy_type_user_data (
object
orNone
) – User data to pass to get_proxy_type_func.cancellable (
Gio.Cancellable
orNone
) – AGio.Cancellable
orNone
- Raises:
- Returns:
A
Gio.DBusObjectManagerClient
object orNone
if error is set. Free withGObject.Object.unref
().- Return type:
Creates a new
Gio.DBusObjectManagerClient
object.This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See
Gio.DBusObjectManagerClient.new
() for the asynchronous version.New in version 2.30.
- get_connection()[source]¶
- Returns:
A
Gio.DBusConnection
object. Do not free, the object belongs to self.- Return type:
Gets the
Gio.DBusConnection
used by self.New in version 2.30.
- get_flags()[source]¶
- Returns:
Zero of more flags from the
Gio.DBusObjectManagerClientFlags
enumeration.- Return type:
Gets the flags that self was constructed with.
New in version 2.30.
- get_name()[source]¶
- Returns:
A unique or well-known name. Do not free, the string belongs to self.
- Return type:
Gets the name that self is for, or
None
if not a message bus connection.New in version 2.30.
- get_name_owner()[source]¶
-
The unique name that owns the name that self is for or
None
if no-one currently owns that name. You can connect to theGObject.Object
::notify
signal to track changes to theGio.DBusObjectManagerClient
:name-owner
property.New in version 2.30.
- do_interface_proxy_properties_changed(object_proxy, interface_proxy, changed_properties, invalidated_properties) virtual¶
- Parameters:
object_proxy (
Gio.DBusObjectProxy
) –interface_proxy (
Gio.DBusProxy
) –changed_properties (
GLib.Variant
) –invalidated_properties (
str
) –
Signal class handler for the
Gio.DBusObjectManagerClient
::interface-proxy-properties-changed
signal.
- do_interface_proxy_signal(object_proxy, interface_proxy, sender_name, signal_name, parameters) virtual¶
- Parameters:
object_proxy (
Gio.DBusObjectProxy
) –interface_proxy (
Gio.DBusProxy
) –sender_name (
str
) –signal_name (
str
) –parameters (
GLib.Variant
) –
Signal class handler for the
Gio.DBusObjectManagerClient
::interface-proxy-signal
signal.
Signal Details¶
- Gio.DBusObjectManagerClient.signals.interface_proxy_properties_changed(d_bus_object_manager_client, object_proxy, interface_proxy, changed_properties, invalidated_properties)¶
- Signal Name:
interface-proxy-properties-changed
- Flags:
- Parameters:
d_bus_object_manager_client (
Gio.DBusObjectManagerClient
) – The object which received the signalobject_proxy (
Gio.DBusObjectProxy
) – TheGio.DBusObjectProxy
on which an interface has properties that are changing.interface_proxy (
Gio.DBusProxy
) – TheGio.DBusProxy
that has properties that are changing.changed_properties (
GLib.Variant
) – AGLib.Variant
containing the properties that changed (type:a{sv}
).invalidated_properties ([
str
]) – ANone
terminated array of properties that were invalidated.
Emitted when one or more D-Bus properties on proxy changes. The local cache has already been updated when this signal fires. Note that both changed_properties and invalidated_properties are guaranteed to never be
None
(either may be empty though).This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager.
This signal is emitted in the
thread-default main context
that manager was constructed in.New in version 2.30.
- Gio.DBusObjectManagerClient.signals.interface_proxy_signal(d_bus_object_manager_client, object_proxy, interface_proxy, sender_name, signal_name, parameters)¶
- Signal Name:
interface-proxy-signal
- Flags:
- Parameters:
d_bus_object_manager_client (
Gio.DBusObjectManagerClient
) – The object which received the signalobject_proxy (
Gio.DBusObjectProxy
) – TheGio.DBusObjectProxy
on which an interface is emitting a D-Bus signal.interface_proxy (
Gio.DBusProxy
) – TheGio.DBusProxy
that is emitting a D-Bus signal.sender_name (
str
) – The sender of the signal orNone
if the connection is not a bus connection.signal_name (
str
) – The signal name.parameters (
GLib.Variant
) – AGLib.Variant
tuple with parameters for the signal.
Emitted when a D-Bus signal is received on interface_proxy.
This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by manager.
This signal is emitted in the
thread-default main context
that manager was constructed in.New in version 2.30.
Property Details¶
- Gio.DBusObjectManagerClient.props.bus_type¶
- Name:
bus-type
- Type:
- Default Value:
- Flags:
If this property is not
Gio.BusType.NONE
, thenGio.DBusObjectManagerClient
:connection
must beNone
and will be set to theGio.DBusConnection
obtained by callingGio.bus_get
() with the value of this property.New in version 2.30.
- Gio.DBusObjectManagerClient.props.connection¶
- Name:
connection
- Type:
- Default Value:
- Flags:
The
Gio.DBusConnection
to use.New in version 2.30.
- Gio.DBusObjectManagerClient.props.flags¶
- Name:
flags
- Type:
- Default Value:
- Flags:
Flags from the
Gio.DBusObjectManagerClientFlags
enumeration.New in version 2.30.
- Gio.DBusObjectManagerClient.props.get_proxy_type_destroy_notify¶
- Name:
get-proxy-type-destroy-notify
- Type:
- Default Value:
- Flags:
A
GLib.DestroyNotify
for theobject
user_data inGio.DBusObjectManagerClient
:get-proxy-type-user-data
.New in version 2.30.
- Gio.DBusObjectManagerClient.props.get_proxy_type_func¶
- Name:
get-proxy-type-func
- Type:
- Default Value:
- Flags:
The
Gio.DBusProxyTypeFunc
to use when determining whatGObject.GType
to use for interface proxies orNone
.New in version 2.30.
- Gio.DBusObjectManagerClient.props.get_proxy_type_user_data¶
- Name:
get-proxy-type-user-data
- Type:
- Default Value:
- Flags:
The
object
user_data to pass toGio.DBusObjectManagerClient
:get-proxy-type-func
.New in version 2.30.
- Gio.DBusObjectManagerClient.props.name¶
- Name:
name
- Type:
- Default Value:
- Flags:
The well-known name or unique name that the manager is for.
New in version 2.30.
- Gio.DBusObjectManagerClient.props.name_owner¶
-
The unique name that owns
Gio.DBusObjectManagerClient
:name
orNone
if no-one is currently owning the name. Connect to theGObject.Object
::notify
signal to track changes to this property.New in version 2.30.