Class Controller
- java.lang.Object
-
- org.restlet.ext.nio.internal.controller.Controller
-
- Direct Known Subclasses:
ConnectionController
@Deprecated public abstract class Controller extends java.lang.ObjectDeprecated.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<?>helperDeprecated.The parent connector helper.protected booleanoverloadedDeprecated.Indicates if the controller is overloaded.protected booleanrunningDeprecated.Indicates if the task is running.
-
Constructor Summary
Constructors Constructor Description Controller(ConnectionHelper<?> helper)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voiddoInit()Deprecated.Initializes the controller before entering the control loop.protected voiddoRelease()Deprecated.Method called-back with the controller stops running.protected voiddoRun(long sleepTime)Deprecated.Do the actual controller work.protected ConnectionHelper<?>getHelper()Deprecated.Returns the parent connector helper.protected java.util.concurrent.ExecutorServicegetWorkerService()Deprecated.Returns the helper's worker service.booleanisOverloaded()Deprecated.Indicates if the controller is overloaded.booleanisRunning()Deprecated.Indicates if the task is running.voidrun()Deprecated.Listens on the given server socket for incoming connections.voidsetOverloaded(boolean overloaded)Deprecated.Indicates if the controller is overloaded.private voidsetRunning(boolean running)Deprecated.Indicates if the task is running.voidshutdown()Deprecated.Abort the controller.
-
-
-
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.IOExceptionDeprecated.Do the actual controller work. Called by therun()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.
-
-