Interface DBusConnection.ClosedCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
DBusConnection
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface DBusConnection.ClosedCallback extends FunctionPointer

Functional interface declaration of the ClosedCallback callback.

Since:
2.26
See Also:
  • Method Details

    • run

      void run(boolean remotePeerVanished, @Nullable GError error)

      Emitted when the connection is closed.

      The cause of this event can be

      • If g_dbus_connection_close() is called. In this case remotePeerVanished is set to false and error is null.

      • If the remote peer closes the connection. In this case remotePeerVanished is set to true and error is set.

      • If the remote peer sends invalid or malformed data. In this case remotePeerVanished is set to false and error is set.

      Upon receiving this signal, you should give up your reference to connection. You are guaranteed that this signal is emitted only once.

      Since:
      2.26
    • upcall

      default void upcall(MemorySegment sourceDBusConnection, int remotePeerVanished, MemorySegment error)
      The upcall method is called from native code. The parameters are marshaled and run(boolean, GError) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, int, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer