Class ServerImpl

java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.server.ServerImpl
All Implemented Interfaces:
Server

@ThreadSafe public final class ServerImpl extends com.tenio.common.logger.SystemLogger implements Server
This class manages the workflow of the current server. The instruction's orders are important, event subscribes must be set last and all configuration values should be confirmed.
  • Method Details

    • getInstance

      public static Server getInstance()
      Preventing Singleton object instantiation from outside and creates multiple instance if two thread access this method simultaneously.
      Returns:
      a new instance
    • start

      public void start(BootstrapHandler bootstrapHandler, String[] params) throws Exception
      Description copied from interface: Server
      Start the server base on your own configurations.
      Specified by:
      start in interface Server
      Throws:
      Exception
    • shutdown

      public void shutdown()
      Description copied from interface: Server
      Shut down the server and close all services.
      Specified by:
      shutdown in interface Server
    • getApi

      public ServerApi getApi()
      Specified by:
      getApi in interface Server
    • getEventManager

      public EventManager getEventManager()
      Specified by:
      getEventManager in interface Server
    • getPlayerManager

      public PlayerManager getPlayerManager()
      Specified by:
      getPlayerManager in interface Server
    • getRoomManager

      public RoomManager getRoomManager()
      Specified by:
      getRoomManager in interface Server
    • write

      public void write(Response response)
      Specified by:
      write in interface Server