public abstract class AbstractNonblockingServer extends TServer
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractNonblockingServer.AbstractNonblockingServerArgs<T extends AbstractNonblockingServer.AbstractNonblockingServerArgs<T>> |
protected class |
AbstractNonblockingServer.AbstractSelectThread
An abstract thread that handles selecting on a set of transports and
FrameBuffers associated with selected keys
corresponding to requests. |
protected class |
AbstractNonblockingServer.FrameBuffer
Class that implements a sort of state machine around the interaction with a
client and an invoker.
|
TServer.AbstractServerArgs<T extends TServer.AbstractServerArgs<T>>, TServer.Args| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
LOGGER |
eventHandler_, inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_| Constructor and Description |
|---|
AbstractNonblockingServer(AbstractNonblockingServer.AbstractNonblockingServerArgs args) |
| Modifier and Type | Method and Description |
|---|---|
TServerEventHandler |
getEventHandler() |
protected abstract boolean |
requestInvoke(AbstractNonblockingServer.FrameBuffer frameBuffer)
Perform an invocation.
|
void |
serve()
Begin accepting connections and processing invocations.
|
void |
setServerEventHandler(TServerEventHandler eventHandler) |
protected boolean |
startListening()
Have the server transport start accepting connections.
|
protected abstract boolean |
startThreads()
Starts any threads required for serving.
|
protected void |
stopListening()
Stop listening for connections.
|
protected abstract void |
waitForShutdown()
A method that will block until when threads handling the serving have been
shut down.
|
isServing, setServing, stoppublic AbstractNonblockingServer(AbstractNonblockingServer.AbstractNonblockingServerArgs args)
public void serve()
protected abstract boolean startThreads()
protected abstract void waitForShutdown()
protected boolean startListening()
protected void stopListening()
protected abstract boolean requestInvoke(AbstractNonblockingServer.FrameBuffer frameBuffer)
public void setServerEventHandler(TServerEventHandler eventHandler)
setServerEventHandler in class TServerpublic TServerEventHandler getEventHandler()
getEventHandler in class TServer