Class AbstractZeroEngine

java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.manager.AbstractManager
com.tenio.core.network.zero.engine.implement.AbstractZeroEngine
All Implemented Interfaces:
ZeroEngine, Service, ServiceListener, Runnable
Direct Known Subclasses:
ZeroAcceptorImpl, ZeroReaderImpl, ZeroWriterImpl

public abstract class AbstractZeroEngine extends AbstractManager implements ZeroEngine, Runnable
The abstract engine.
  • Constructor Details

    • AbstractZeroEngine

      protected AbstractZeroEngine(EventManager eventManager)
      Initialization.
      Parameters:
      eventManager - the event manger
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getSocketIoHandler

      public SocketIoHandler getSocketIoHandler()
      Description copied from interface: ZeroEngine
      Retrieves the socket IO handler.
      Specified by:
      getSocketIoHandler in interface ZeroEngine
      Returns:
      the socket IO handler
    • setSocketIoHandler

      public void setSocketIoHandler(SocketIoHandler socketIoHandler)
      Description copied from interface: ZeroEngine
      Set the socket IO handler.
      Specified by:
      setSocketIoHandler in interface ZeroEngine
      Parameters:
      socketIoHandler - the socket IO handler
    • getDatagramIoHandler

      public DatagramIoHandler getDatagramIoHandler()
      Description copied from interface: ZeroEngine
      Retrieves the datagram IO handler.
      Specified by:
      getDatagramIoHandler in interface ZeroEngine
      Returns:
      the datagram IO handler
    • setDatagramIoHandler

      public void setDatagramIoHandler(DatagramIoHandler datagramIoHandler)
      Description copied from interface: ZeroEngine
      Set the datagram IO handler.
      Specified by:
      setDatagramIoHandler in interface ZeroEngine
      Parameters:
      datagramIoHandler - the datagram IO handler
    • getSessionManager

      public SessionManager getSessionManager()
      Description copied from interface: ZeroEngine
      Retrieves the session manager.
      Specified by:
      getSessionManager in interface ZeroEngine
      Returns:
      the session manager
    • setSessionManager

      public void setSessionManager(SessionManager sessionManager)
      Description copied from interface: ZeroEngine
      Set the session manager.
      Specified by:
      setSessionManager in interface ZeroEngine
      Parameters:
      sessionManager - the session manager
    • getThreadPoolSize

      public int getThreadPoolSize()
      Description copied from interface: ZeroEngine
      Retrieves the thread pool size.
      Specified by:
      getThreadPoolSize in interface ZeroEngine
      Returns:
      the thread pool size
    • setThreadPoolSize

      public void setThreadPoolSize(int maxSize)
      Description copied from interface: ZeroEngine
      Set the thread pool size.
      Specified by:
      setThreadPoolSize in interface ZeroEngine
      Parameters:
      maxSize - the thread pool size
    • getMaxBufferSize

      public int getMaxBufferSize()
      Description copied from interface: ZeroEngine
      Retrieves the max buffer size.
      Specified by:
      getMaxBufferSize in interface ZeroEngine
      Returns:
      the max buffer size
    • setMaxBufferSize

      public void setMaxBufferSize(int maxSize)
      Description copied from interface: ZeroEngine
      Set the max buffer size.
      Specified by:
      setMaxBufferSize in interface ZeroEngine
      Parameters:
      maxSize - the max buffer size
    • initialize

      public void initialize()
      Description copied from interface: Service
      Initializes a new service.
      Specified by:
      initialize in interface Service
    • start

      public void start()
      Description copied from interface: Service
      Start the service.
      Specified by:
      start in interface Service
    • shutdown

      public void shutdown()
      Description copied from interface: Service
      Shutdown the service.
      Specified by:
      shutdown in interface Service
    • isActivated

      public boolean isActivated()
      Description copied from interface: Service
      Determines whether the service is activated.
      Specified by:
      isActivated in interface Service
      Returns:
      true if the service is activated, false otherwise
    • getName

      public String getName()
      Description copied from interface: Service
      Retrieves the service's name.
      Specified by:
      getName in interface Service
      Returns:
      the service's name
    • setName

      public void setName(String name)
      Description copied from interface: Service
      Set the service's name.
      Specified by:
      setName in interface Service
      Parameters:
      name - the service's name