Class NioServer

  • All Implemented Interfaces:

    public class NioServer
    Creates a simple server listener which listens for incoming client connections and uses a StreamConnection to process data.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface,
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void run()  
      void triggerShutdown()
      Invoked by the Execution service when it's time to stop.
      • Methods inherited from class

        addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, executor, failureCause, isRunning, serviceName, shutDown, startAsync, startUp, state, stopAsync, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NioServer

        public NioServer​(StreamConnectionFactory connectionFactory,
        Creates a new server which is capable of listening for incoming connections and processing client provided data using StreamConnections created by the given StreamConnectionFactory
        Throws: - If there is an issue opening the server socket or binding fails for some reason
    • Method Detail

      • run

        protected void run()
                    throws java.lang.Exception
        Specified by:
        run in class
      • triggerShutdown

        public void triggerShutdown()
        Invoked by the Execution service when it's time to stop. Calling this method directly will NOT stop the service, call AbstractExecutionThreadService.stopAsync() instead.
        triggerShutdown in class