Class AbstractController

java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.manager.AbstractManager
com.tenio.core.controller.AbstractController
All Implemented Interfaces:
Controller, Service, ServiceListener, Runnable
Direct Known Subclasses:
InternalProcessorServiceImpl

public abstract class AbstractController extends AbstractManager implements Controller, Runnable
The abstracted class for controllers.
  • Constructor Details

    • AbstractController

      protected AbstractController(EventManager eventManager)
      Initialization.
      Parameters:
      eventManager - the event manager
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • 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
    • 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
    • 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
    • enqueueRequest

      public void enqueueRequest(Request request)
      Description copied from interface: Controller
      Enqueue a request for processing.
      Specified by:
      enqueueRequest in interface Controller
      Parameters:
      request - the request
    • getMaxRequestQueueSize

      public int getMaxRequestQueueSize()
      Description copied from interface: Controller
      Retrieves the max request size.
      Specified by:
      getMaxRequestQueueSize in interface Controller
      Returns:
      the max request size
    • setMaxRequestQueueSize

      public void setMaxRequestQueueSize(int maxSize)
      Description copied from interface: Controller
      Set the maximum value size for the queue.
      Specified by:
      setMaxRequestQueueSize in interface Controller
      Parameters:
      maxSize - the max size
    • getThreadPoolSize

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

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

      public float getPercentageUsedRequestQueue()
      Description copied from interface: Controller
      Retrieves the current percentage using of request queue.
      Specified by:
      getPercentageUsedRequestQueue in interface Controller
      Returns:
      the percentage
    • subscribe

      public abstract void subscribe()
      Subscribe.
    • processRequest

      public abstract void processRequest(Request request)
      Processes a request.
      Parameters:
      request - the processing request