Package org.gnome.gio
Class ThreadedSocketService.Builder<B extends ThreadedSocketService.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>
org.gnome.gio.ThreadedSocketService.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
ThreadedSocketService
public static class ThreadedSocketService.Builder<B extends ThreadedSocketService.Builder<B>>
extends SocketService.Builder<B>
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theThreadedSocketService
object.onRun
(ThreadedSocketService.RunCallback handler) The ::run signal is emitted in a worker thread in response to an incoming connection.setMaxThreads
(int maxThreads) The maximum number of threads handling clients for this service.Methods inherited from class org.gnome.gio.SocketService.Builder
onIncoming, setActive
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 theThreadedSocketService
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 toThreadedSocketService
.- Overrides:
build
in classSocketService.Builder<B extends ThreadedSocketService.Builder<B>>
- Returns:
- a new instance of
ThreadedSocketService
with the properties that were set in the Builder object.
-
setMaxThreads
The maximum number of threads handling clients for this service.- Parameters:
maxThreads
- the value for themax-threads
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onRun
The ::run signal is emitted in a worker thread in response to an incoming connection. This thread is dedicated to handlingconnection
and may perform blocking IO. The signal handler need not return until the connection is closed.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-