java.lang.Object
swim.io.Station
Asynchronous I/O multiplexor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StageStage on which to execute I/O tasks.protected TransportSettingsTransport configuration parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidLifecycle callback invoked if the selector thread throws a fatalerror.protected voiddidStart()Lifecycle callback invoked after the selector thread starts.protected voiddidStop()Lifecycle callback invoked after the selector thread stops.final Stagestage()Returns theStageon which thisStationexecutes I/O tasks.voidstart()Ensures that thisStationis up and running, starting up the selector thread if it has not yet been started.voidstop()Ensures that thisStationhas been permanently stopped, shutting down the selector thread, if it's currently running.transport(Transport transport, FlowControl flowControl) Binds the giventransportto thisStation, initializing thetransport's context with the givenflowControlstate.protected voidtransportDidAccept(Transport transport) Introspection callback invoked after atransportcompletes an accept operation.protected voidtransportDidClose(Transport transport) Introspection callback invoked after atransportcloses.protected voidtransportDidConnect(Transport transport) Introspection callback invoked after atransportcompletes a connect operation.protected voidtransportDidFail(Transport transport, Throwable error) Introspection callback invoked after atransportoperation fails by throwing anerror.protected voidtransportDidTimeout(Transport transport) Introspection callback invoked after atransporttimes out.final TransportSettingsReturns the transport configuration parameters that govern thisStation's regsitered transports.transportSettings(TransportSettings transportSettings) Updates the transport configuration parameters that govern thisStation's registered transports, and returnsthis.protected voidLifecycle callback invoked before the selector thread starts.protected voidwillStop()Lifecycle callback invoked before the selector thread stops.
-
Field Details
-
stage
Stage on which to execute I/O tasks. -
transportSettings
Transport configuration parameters.
-
-
Constructor Details
-
Station
-
Station
-
-
Method Details
-
stage
Returns theStageon which thisStationexecutes I/O tasks. -
transportSettings
Returns the transport configuration parameters that govern thisStation's regsitered transports. -
transportSettings
Updates the transport configuration parameters that govern thisStation's registered transports, and returnsthis. -
start
public void start()Ensures that thisStationis up and running, starting up the selector thread if it has not yet been started.- Throws:
StationException- if thisStationhas been stopped.
-
stop
public void stop()Ensures that thisStationhas been permanently stopped, shutting down the selector thread, if it's currently running. Upon return, thisStationis guaranteed to be in the stopped state. -
transport
Binds the giventransportto thisStation, initializing thetransport's context with the givenflowControlstate. TheStationthereafter asynchronously executes I/O tasks on behalf of thetransportwhen the underlying physical transport is ready for I/O operations permitted by thetransport's current flow control state. Returns aTransportRef, which can be used to modify the flow control of thetransport, and to close thetransport. -
willStart
protected void willStart()Lifecycle callback invoked before the selector thread starts. -
didStart
protected void didStart()Lifecycle callback invoked after the selector thread starts. -
willStop
protected void willStop()Lifecycle callback invoked before the selector thread stops. -
didStop
protected void didStop()Lifecycle callback invoked after the selector thread stops. -
didFail
Lifecycle callback invoked if the selector thread throws a fatalerror. The selector thread will stop after invokingdidFail. -
transportDidAccept
Introspection callback invoked after atransportcompletes an accept operation. -
transportDidConnect
Introspection callback invoked after atransportcompletes a connect operation. -
transportDidTimeout
Introspection callback invoked after atransporttimes out. -
transportDidClose
Introspection callback invoked after atransportcloses. -
transportDidFail
Introspection callback invoked after atransportoperation fails by throwing anerror.
-