Class DBusInterfaceSkeleton
- All Implemented Interfaces:
Proxy
,DBusInterface
- Direct Known Subclasses:
DBusInterfaceSkeleton.DBusInterfaceSkeletonImpl
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Inner class implementing a builder pattern to construct a GObject with properties.static class
Class structure forGDBusInterfaceSkeleton
.static class
The DBusInterfaceSkeletonImpl type represents a native instance of the abstract DBusInterfaceSkeleton class.static interface
Functional interface declaration of theGAuthorizeMethodCallback
callback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.DBusInterface
DBusInterface.DBusInterfaceIface, DBusInterface.DBusInterfaceImpl
-
Constructor Summary
ConstructorDescriptionDBusInterfaceSkeleton
(MemorySegment address) Create a DBusInterfaceSkeleton proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected DBusInterfaceSkeleton
asParent()
Returns this instance as if it were its parent type.static DBusInterfaceSkeleton.Builder
<? extends DBusInterfaceSkeleton.Builder> builder()
ADBusInterfaceSkeleton.Builder
object constructs aDBusInterfaceSkeleton
with the specified properties.boolean
emitGAuthorizeMethod
(DBusMethodInvocation invocation) Emits the "g-authorize-method" signal.boolean
export
(DBusConnection connection, String objectPath) Exports this DBusInterfaceSkeleton atobjectPath
onconnection
.void
flush()
If this DBusInterfaceSkeleton has outstanding changes, request for these changes to be emitted immediately.protected boolean
gAuthorizeMethod
(DBusMethodInvocation invocation) Signal class handler for theGDBusInterfaceSkeleton
::g-authorize-method signal.Gets the first connection that this DBusInterfaceSkeleton is exported on, if any.Gets a list of the connections that this DBusInterfaceSkeleton is exported on.getFlags()
Gets theGDBusInterfaceSkeletonFlags
that describes what the behavior of this DBusInterfaceSkeletongetInfo()
Gets D-Bus introspection information for the D-Bus interface implemented by this DBusInterfaceSkeleton.static MemoryLayout
The memory layout of the native struct.Gets the object path that this DBusInterfaceSkeleton is exported on, if any.Gets all D-Bus properties for this DBusInterfaceSkeleton.static Type
getType()
Get the GType of the DBusInterfaceSkeleton classGets the interface vtable for the D-Bus interface implemented by this DBusInterfaceSkeleton.boolean
hasConnection
(DBusConnection connection) Checks if this DBusInterfaceSkeleton is exported onconnection
.Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.void
setFlags
(Set<DBusInterfaceSkeletonFlags> flags) Sets flags describing what the behavior ofskeleton
should be.void
setFlags
(DBusInterfaceSkeletonFlags... flags) Sets flags describing what the behavior ofskeleton
should be.void
unexport()
Stops exporting this DBusInterfaceSkeleton on all connections it is exported on.void
unexportFromConnection
(DBusConnection connection) Stops exporting this DBusInterfaceSkeleton onconnection
.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.DBusInterface
getObject, setObject
-
Constructor Details
-
DBusInterfaceSkeleton
Create a DBusInterfaceSkeleton proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
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
Exports this DBusInterfaceSkeleton atobjectPath
onconnection
.This can be called multiple times to export the same this DBusInterfaceSkeleton onto multiple connections however the
objectPath
provided must be the same for all connections.Use g_dbus_interface_skeleton_unexport() to unexport the object.
- Parameters:
connection
- AGDBusConnection
to export this DBusInterfaceSkeleton on.objectPath
- The path to export the interface at.- Returns:
true
if the interface was exported onconnection
, otherwisefalse
witherror
set.- Throws:
GErrorException
- seeGError
-
flush
public void flush()If this DBusInterfaceSkeleton has outstanding changes, request for these changes to be emitted immediately.For example, an exported D-Bus interface may queue up property changes and emit the
org.freedesktop.DBus.Properties.PropertiesChanged
signal later (e.g. in an idle handler). This technique is useful for collapsing multiple property changes into one. -
getConnection
Gets the first connection that this DBusInterfaceSkeleton is exported on, if any.- Returns:
- A
GDBusConnection
ornull
if this DBusInterfaceSkeleton is not exported anywhere. Do not free, the object belongs to this DBusInterfaceSkeleton.
-
getConnections
Gets a list of the connections that this DBusInterfaceSkeleton is exported on.- Returns:
- A list of all the connections that this DBusInterfaceSkeleton is exported on. The returned list should be freed with g_list_free() after each element has been freed with g_object_unref().
-
getFlags
Gets theGDBusInterfaceSkeletonFlags
that describes what the behavior of this DBusInterfaceSkeleton- Returns:
- One or more flags from the
GDBusInterfaceSkeletonFlags
enumeration.
-
getInfo
Gets D-Bus introspection information for the D-Bus interface implemented by this DBusInterfaceSkeleton.- Specified by:
getInfo
in interfaceDBusInterface
- Returns:
- A
GDBusInterfaceInfo
(nevernull
). Do not free.
-
getObjectPath
Gets the object path that this DBusInterfaceSkeleton is exported on, if any.- Returns:
- A string owned by this DBusInterfaceSkeleton or
null
if this DBusInterfaceSkeleton is not exported anywhere. Do not free, the string belongs to this DBusInterfaceSkeleton.
-
getProperties
Gets all D-Bus properties for this DBusInterfaceSkeleton.- Returns:
- A
GVariant
of type ['a{sv}'][G-VARIANT-TYPE-VARDICT:CAPS]. Free with g_variant_unref().
-
getVtable
Gets the interface vtable for the D-Bus interface implemented by this DBusInterfaceSkeleton. The returned function pointers should expect this DBusInterfaceSkeleton itself to be passed asuserData
.- Returns:
- the vtable of the D-Bus interface implemented by the skeleton
-
hasConnection
Checks if this DBusInterfaceSkeleton is exported onconnection
.- Parameters:
connection
- AGDBusConnection
.- Returns:
true
if this DBusInterfaceSkeleton is exported onconnection
,false
otherwise.
-
setFlags
Sets flags describing what the behavior ofskeleton
should be.- Parameters:
flags
- Flags from theGDBusInterfaceSkeletonFlags
enumeration.
-
setFlags
Sets flags describing what the behavior ofskeleton
should be.- Parameters:
flags
- Flags from theGDBusInterfaceSkeletonFlags
enumeration.
-
unexport
public void unexport()Stops exporting this DBusInterfaceSkeleton on all connections it is exported on.To unexport this DBusInterfaceSkeleton from only a single connection, use g_dbus_interface_skeleton_unexport_from_connection()
-
unexportFromConnection
Stops exporting this DBusInterfaceSkeleton onconnection
.To stop exporting on all connections the interface is exported on, use g_dbus_interface_skeleton_unexport().
- Parameters:
connection
- AGDBusConnection
.
-
gAuthorizeMethod
Signal class handler for theGDBusInterfaceSkeleton
::g-authorize-method signal. -
onGAuthorizeMethod
public SignalConnection<DBusInterfaceSkeleton.GAuthorizeMethodCallback> onGAuthorizeMethod(DBusInterfaceSkeleton.GAuthorizeMethodCallback handler) Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.Note that this signal is emitted in a thread dedicated to handling the method call so handlers are allowed to perform blocking IO. This means that it is appropriate to call e.g. polkit_authority_check_authorization_sync() with the POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION flag set.
If
false
is returned then no further handlers are run and the signal handler must take a reference toinvocation
and finish handling the call (e.g. return an error via g_dbus_method_invocation_return_error()).Otherwise, if
true
is returned, signal emission continues. If no handlers returnfalse
, then the method is dispatched. Ifinterface_
has an enclosingGDBusObjectSkeleton
, then theGDBusObjectSkeleton
::authorize-method signal handlers run before the handlers for this signal.The default class handler just returns
true
.Please note that the common case is optimized: if no signals handlers are connected and the default class handler isn't overridden (for both
interface_
and the enclosingGDBusObjectSkeleton
, if any) andGDBusInterfaceSkeleton
:g-flags does not have theDBusInterfaceSkeletonFlags.HANDLE_METHOD_INVOCATIONS_IN_THREAD
flags set, no dedicated thread is ever used and the call will be handled in the same thread as the object thatinterface_
belongs to was exported in.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitGAuthorizeMethod
Emits the "g-authorize-method" signal. SeeonGAuthorizeMethod(org.gnome.gio.DBusInterfaceSkeleton.GAuthorizeMethodCallback)
. -
builder
ADBusInterfaceSkeleton.Builder
object constructs aDBusInterfaceSkeleton
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withDBusInterfaceSkeleton.Builder.build()
.
-