Class DBusProxy.Builder<B extends DBusProxy.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
DBusProxy
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theDBusProxy
object.Emitted when one or more D-Bus properties onproxy
changes.onGSignal
(@Nullable String detail, DBusProxy.GSignalCallback handler) Emitted when a signal from the remote object and interface thatproxy
is for, has been received.setGBusType
(BusType gBusType) If this property is notBusType.NONE
, thenGDBusProxy
:g-connection must benull
and will be set to theGDBusConnection
obtained by calling g_bus_get() with the value of this property.setGConnection
(DBusConnection gConnection) TheGDBusConnection
the proxy is for.setGDefaultTimeout
(int gDefaultTimeout) The timeout to use if -1 (specifying default timeout) is passed astimeoutMsec
in the g_dbus_proxy_call() and g_dbus_proxy_call_sync() functions.setGFlags
(Set<DBusProxyFlags> gFlags) Flags from theGDBusProxyFlags
enumeration.setGFlags
(DBusProxyFlags... gFlags) Flags from theGDBusProxyFlags
enumeration.setGInterfaceInfo
(DBusInterfaceInfo gInterfaceInfo) Ensure that interactions with this proxy conform to the given interface.setGInterfaceName
(String gInterfaceName) The D-Bus interface name the proxy is for.The well-known or unique name that the proxy is for.setGObjectPath
(String gObjectPath) The object path the proxy is for.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theDBusProxy
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toDBusProxy
.- Overrides:
build
in classGObject.Builder<B extends DBusProxy.Builder<B>>
- Returns:
- a new instance of
DBusProxy
with the properties that were set in the Builder object.
-
setGBusType
If this property is notBusType.NONE
, thenGDBusProxy
:g-connection must benull
and will be set to theGDBusConnection
obtained by calling g_bus_get() with the value of this property.- Parameters:
gBusType
- the value for theg-bus-type
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setGConnection
TheGDBusConnection
the proxy is for.- Parameters:
gConnection
- the value for theg-connection
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setGDefaultTimeout
The timeout to use if -1 (specifying default timeout) is passed astimeoutMsec
in the g_dbus_proxy_call() and g_dbus_proxy_call_sync() functions.This allows applications to set a proxy-wide timeout for all remote method invocations on the proxy. If this property is -1, the default timeout (typically 25 seconds) is used. If set to
G_MAXINT
, then no timeout is used.- Parameters:
gDefaultTimeout
- the value for theg-default-timeout
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setGFlags
Flags from theGDBusProxyFlags
enumeration.- Parameters:
gFlags
- the value for theg-flags
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setGInterfaceInfo
Ensure that interactions with this proxy conform to the given interface. This is mainly to ensure that malformed data received from the other peer is ignored. The givenGDBusInterfaceInfo
is said to be the "expected interface".The checks performed are:
- When completing a method call, if the type signature of
the reply message isn't what's expected, the reply is
discarded and the
GError
is set toIOErrorEnum.INVALID_ARGUMENT
.
- Received signals that have a type signature mismatch are dropped and a warning is logged via g_warning().
- Properties received via the initial
GetAll()
call or via the::PropertiesChanged
signal (on the org.freedesktop.DBus.Properties interface) or set using g_dbus_proxy_set_cached_property() with a type signature mismatch are ignored and a warning is logged via g_warning().
Note that these checks are never done on methods, signals and properties that are not referenced in the given
GDBusInterfaceInfo
, since extending a D-Bus interface on the service-side is not considered an ABI break.- Parameters:
gInterfaceInfo
- the value for theg-interface-info
property- Returns:
- the
Builder
instance is returned, to allow method chaining
- When completing a method call, if the type signature of
the reply message isn't what's expected, the reply is
discarded and the
-
setGInterfaceName
-
setGName
-
setGObjectPath
-
setGFlags
Flags from theGDBusProxyFlags
enumeration.- Parameters:
gFlags
- the value for theg-flags
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onGPropertiesChanged
Emitted when one or more D-Bus properties onproxy
changes. The local cache has already been updated when this signal fires. Note that bothchangedProperties
andinvalidatedProperties
are guaranteed to never benull
(either may be empty though).If the proxy has the flag
DBusProxyFlags.GET_INVALIDATED_PROPERTIES
set, theninvalidatedProperties
will always be empty.This signal corresponds to the
PropertiesChanged
D-Bus signal on theorg.freedesktop.DBus.Properties
interface.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onGSignal
Emitted when a signal from the remote object and interface thatproxy
is for, has been received.Since 2.72 this signal supports detailed connections. You can connect to the detailed signal
g-signal::x
in order to receive callbacks only when signalx
is received from the remote object.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-