Class Controller

  • Direct Known Subclasses:
    ConnectionController

    @Deprecated
    public abstract class Controller
    extends java.lang.Object
    Deprecated.
    Will be removed to favor lower-level network extensions allowing more control at the Restlet API level.
    Controls the IO work of parent connector helper.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected ConnectionHelper<?> helper
      Deprecated.
      The parent connector helper.
      protected boolean overloaded
      Deprecated.
      Indicates if the controller is overloaded.
      protected boolean running
      Deprecated.
      Indicates if the task is running.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void doInit()
      Deprecated.
      Initializes the controller before entering the control loop.
      protected void doRelease()
      Deprecated.
      Method called-back with the controller stops running.
      protected void doRun​(long sleepTime)
      Deprecated.
      Do the actual controller work.
      protected ConnectionHelper<?> getHelper()
      Deprecated.
      Returns the parent connector helper.
      protected java.util.concurrent.ExecutorService getWorkerService()
      Deprecated.
      Returns the helper's worker service.
      boolean isOverloaded()
      Deprecated.
      Indicates if the controller is overloaded.
      boolean isRunning()
      Deprecated.
      Indicates if the task is running.
      void run()
      Deprecated.
      Listens on the given server socket for incoming connections.
      void setOverloaded​(boolean overloaded)
      Deprecated.
      Indicates if the controller is overloaded.
      private void setRunning​(boolean running)
      Deprecated.
      Indicates if the task is running.
      void shutdown()
      Deprecated.
      Abort the controller.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • helper

        protected final ConnectionHelper<?> helper
        Deprecated.
        The parent connector helper.
      • overloaded

        protected boolean overloaded
        Deprecated.
        Indicates if the controller is overloaded.
      • running

        protected boolean running
        Deprecated.
        Indicates if the task is running.
    • Constructor Detail

      • Controller

        public Controller​(ConnectionHelper<?> helper)
        Deprecated.
        Constructor.
        Parameters:
        helper - The parent connector helper.
    • Method Detail

      • doInit

        protected void doInit()
        Deprecated.
        Initializes the controller before entering the control loop.
      • doRelease

        protected void doRelease()
        Deprecated.
        Method called-back with the controller stops running.
      • doRun

        protected void doRun​(long sleepTime)
                      throws java.io.IOException
        Deprecated.
        Do the actual controller work. Called by the run() to provide an easy method to overload.
        Parameters:
        sleepTime - The maximum amount of sleep time.
        Throws:
        java.io.IOException
      • getHelper

        protected ConnectionHelper<?> getHelper()
        Deprecated.
        Returns the parent connector helper.
        Returns:
        The parent connector helper.
      • getWorkerService

        protected java.util.concurrent.ExecutorService getWorkerService()
        Deprecated.
        Returns the helper's worker service.
        Returns:
        The helper's worker service.
      • isOverloaded

        public boolean isOverloaded()
        Deprecated.
        Indicates if the controller is overloaded.
        Returns:
        True if the controller is overloaded.
      • isRunning

        public boolean isRunning()
        Deprecated.
        Indicates if the task is running.
        Returns:
        True if the task is running.
      • run

        public void run()
        Deprecated.
        Listens on the given server socket for incoming connections.
      • setOverloaded

        public void setOverloaded​(boolean overloaded)
        Deprecated.
        Indicates if the controller is overloaded.
        Parameters:
        overloaded - True if the controller is overloaded.
      • setRunning

        private void setRunning​(boolean running)
        Deprecated.
        Indicates if the task is running.
        Parameters:
        running - True if the task is running.
      • shutdown

        public void shutdown()
        Deprecated.
        Abort the controller.