Class AbstractNonblockingServer

java.lang.Object
org.apache.thrift.server.TServer
org.apache.thrift.server.AbstractNonblockingServer
Direct Known Subclasses:
TNonblockingServer, TThreadedSelectorServer

public abstract class AbstractNonblockingServer extends TServer
Provides common methods and classes used by nonblocking TServer implementations.
  • Field Details

    • LOGGER

      protected final org.slf4j.Logger LOGGER
  • Constructor Details

  • Method Details

    • serve

      public void serve()
      Begin accepting connections and processing invocations.
      Specified by:
      serve in class TServer
    • startThreads

      protected abstract boolean startThreads()
      Starts any threads required for serving.
      Returns:
      true if everything went ok, false if threads could not be started.
    • waitForShutdown

      protected abstract void waitForShutdown()
      A method that will block until when threads handling the serving have been shut down.
    • startListening

      protected boolean startListening()
      Have the server transport start accepting connections.
      Returns:
      true if we started listening successfully, false if something went wrong.
    • stopListening

      protected void stopListening()
      Stop listening for connections.
    • requestInvoke

      protected abstract boolean requestInvoke(AbstractNonblockingServer.FrameBuffer frameBuffer)
      Perform an invocation. This method could behave several different ways - invoke immediately inline, queue for separate execution, etc.
      Returns:
      true if invocation was successfully requested, which is not a guarantee that invocation has completed. False if the request failed.