Package org.gnome.gio
Class ThreadedSocketService.Builder<B extends ThreadedSocketService.Builder<B>>
java.lang.Object
org.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theThreadedSocketServiceobject.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, setActiveMethods inherited from class org.gnome.gio.SocketListener.Builder
onEvent, setListenBacklogMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theThreadedSocketServiceobject. 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:
buildin classSocketService.Builder<B extends ThreadedSocketService.Builder<B>>- Returns:
- a new instance of
ThreadedSocketServicewith 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-threadsproperty- Returns:
- the
Builderinstance is returned, to allow method chaining - Since:
- 2.22
-
onRun
The ::run signal is emitted in a worker thread in response to an incoming connection. This thread is dedicated to handlingconnectionand may perform blocking IO. The signal handler need not return until the connection is closed.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-