|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.thrift.server.TServer
org.apache.thrift.server.TNonblockingServer
public class TNonblockingServer
A nonblocking TServer implementation. This allows for fairness amongst all connected clients in terms of invocations. This server is inherently single-threaded. If you want a limited thread pool coupled with invocation-fairness, see THsHaServer. To use this server, you MUST use a TFramedTransport at the outermost transport, otherwise this server will be unable to determine when a whole method call has been read off the wire. Clients must also use TFramedTransport.
Nested Class Summary | |
---|---|
static class |
TNonblockingServer.AbstractNonblockingServerArgs<T extends TNonblockingServer.AbstractNonblockingServerArgs<T>>
|
static class |
TNonblockingServer.Args
|
protected class |
TNonblockingServer.FrameBuffer
Class that implements a sort of state machine around the interaction with a client and an invoker. |
protected class |
TNonblockingServer.SelectThread
The thread that will be doing all the selecting, managing new connections and those that still need to be read. |
Nested classes/interfaces inherited from class org.apache.thrift.server.TServer |
---|
TServer.AbstractServerArgs<T extends TServer.AbstractServerArgs<T>> |
Field Summary |
---|
Fields inherited from class org.apache.thrift.server.TServer |
---|
inputProtocolFactory_, inputTransportFactory_, outputProtocolFactory_, outputTransportFactory_, processorFactory_, serverTransport_ |
Constructor Summary | |
---|---|
TNonblockingServer(TNonblockingServer.AbstractNonblockingServerArgs args)
|
Method Summary | |
---|---|
boolean |
isStopped()
|
protected void |
joinSelector()
Block until the selector exits. |
protected boolean |
requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
Perform an invocation. |
protected void |
requestSelectInterestChange(TNonblockingServer.FrameBuffer frameBuffer)
A FrameBuffer wants to change its selection preferences, but might not be in the select thread. |
void |
serve()
Begin accepting connections and processing invocations. |
protected boolean |
startListening()
Have the server transport start accepting connections. |
protected boolean |
startSelectorThread()
Start the selector thread running to deal with clients. |
void |
stop()
Stop serving and shut everything down. |
protected void |
stopListening()
Stop listening for conections. |
Methods inherited from class org.apache.thrift.server.TServer |
---|
isServing, setServing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TNonblockingServer(TNonblockingServer.AbstractNonblockingServerArgs args)
Method Detail |
---|
public void serve()
serve
in class TServer
protected boolean startListening()
protected void stopListening()
protected boolean startSelectorThread()
protected void joinSelector()
public void stop()
stop
in class TServer
protected boolean requestInvoke(TNonblockingServer.FrameBuffer frameBuffer)
protected void requestSelectInterestChange(TNonblockingServer.FrameBuffer frameBuffer)
public boolean isStopped()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |