Package org.gnome.gio
Class SocketService.Builder<B extends SocketService.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gio.SocketListener.Builder<B>
org.gnome.gio.SocketService.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Direct Known Subclasses:
ThreadedSocketService.Builder
- Enclosing class:
SocketService
public static class SocketService.Builder<B extends SocketService.Builder<B>>
extends SocketListener.Builder<B>
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theSocketService
object.onIncoming
(SocketService.IncomingCallback handler) The ::incoming signal is emitted when a new incoming connection toservice
needs to be handled.setActive
(boolean active) Whether the service is currently accepting connections.Methods inherited from class org.gnome.gio.SocketListener.Builder
onEvent, setListenBacklog
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 theSocketService
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 toSocketService
.- Overrides:
build
in classSocketListener.Builder<B extends SocketService.Builder<B>>
- Returns:
- a new instance of
SocketService
with the properties that were set in the Builder object.
-
setActive
Whether the service is currently accepting connections.- Parameters:
active
- the value for theactive
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onIncoming
The ::incoming signal is emitted when a new incoming connection toservice
needs to be handled. The handler must initiate the handling ofconnection
, but may not block; in essence, asynchronous operations must be used.connection
will be unreffed once the signal handler returns, so you need to ref it yourself if you are planning to use it.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-