Interface DBusInterfaceSkeleton.GAuthorizeMethodCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
DBusInterfaceSkeleton
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
GAuthorizeMethodCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(DBusMethodInvocation invocation) Emitted when a method is invoked by a remote caller and used to determine if the method call is authorized.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourceDBusInterfaceSkeleton, MemorySegment invocation) Theupcall
method is called from native code.
-
Method Details
-
run
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. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gio.DBusMethodInvocation)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-