Class DBusProxy.Builder<B extends DBusProxy.Builder<B>>
- Type Parameters:
B- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Direct Known Subclasses:
Collection.Builder,Item.Builder,Prompt.Builder,Service.Builder
- Enclosing class:
DBusProxy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theDBusProxyobject.Emitted when one or more D-Bus properties onproxychanges.onGSignal(@Nullable String detail, DBusProxy.GSignalCallback handler) Emitted when a signal from the remote object and interface thatproxyis for, has been received.setGBusType(BusType gBusType) If this property is notBusType.NONE, thenGDBusProxy:g-connection must benulland will be set to theGDBusConnectionobtained by calling g_bus_get() with the value of this property.setGConnection(DBusConnection gConnection) TheGDBusConnectionthe proxy is for.setGDefaultTimeout(int gDefaultTimeout) The timeout to use if -1 (specifying default timeout) is passed astimeoutMsecin the g_dbus_proxy_call() and g_dbus_proxy_call_sync() functions.setGFlags(Set<DBusProxyFlags> gFlags) Flags from theGDBusProxyFlagsenumeration.setGFlags(DBusProxyFlags... gFlags) Flags from theGDBusProxyFlagsenumeration.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
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theDBusProxyobject. 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:
buildin classGObject.Builder<B extends DBusProxy.Builder<B>>- Returns:
- a new instance of
DBusProxywith the properties that were set in the Builder object.
-
setGBusType
If this property is notBusType.NONE, thenGDBusProxy:g-connection must benulland will be set to theGDBusConnectionobtained by calling g_bus_get() with the value of this property.- Parameters:
gBusType- the value for theg-bus-typeproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
-
setGConnection
TheGDBusConnectionthe proxy is for.- Parameters:
gConnection- the value for theg-connectionproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
-
setGDefaultTimeout
The timeout to use if -1 (specifying default timeout) is passed astimeoutMsecin 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-timeoutproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
-
setGFlags
Flags from theGDBusProxyFlagsenumeration.- Parameters:
gFlags- the value for theg-flagsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
-
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 givenGDBusInterfaceInfois 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
GErroris 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::PropertiesChangedsignal (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-infoproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
- 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 theGDBusProxyFlagsenumeration.- Parameters:
gFlags- the value for theg-flagsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
-
onGPropertiesChanged
Emitted when one or more D-Bus properties onproxychanges. The local cache has already been updated when this signal fires. Note that bothchangedPropertiesandinvalidatedPropertiesare guaranteed to never benull(either may be empty though).If the proxy has the flag
DBusProxyFlags.GET_INVALIDATED_PROPERTIESset, theninvalidatedPropertieswill always be empty.This signal corresponds to the
PropertiesChangedD-Bus signal on theorg.freedesktop.DBus.Propertiesinterface.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
- See Also:
-
onGSignal
Emitted when a signal from the remote object and interface thatproxyis for, has been received.Since 2.72 this signal supports detailed connections. You can connect to the detailed signal
g-signal::xin order to receive callbacks only when signalxis received from the remote object.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.26
- See Also:
-