|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.engine.connector.Controller
public abstract class Controller
Controls the IO work of parent connector helper.
| Field Summary | |
|---|---|
protected ConnectionHelper<?> |
helper
The parent connector helper. |
protected boolean |
overloaded
Indicates if the controller is overloaded. |
protected boolean |
running
Indicates if the task is running. |
| Constructor Summary | |
|---|---|
Controller(ConnectionHelper<?> helper)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
doInit()
Initializes the controller before entering the control loop. |
protected void |
doRelease()
Method called-back with the controller stops running. |
protected void |
doRun(long sleepTime)
Do the actual controller work. |
protected ConnectionHelper<?> |
getHelper()
Returns the parent connector helper. |
protected ExecutorService |
getWorkerService()
Returns the helper's worker service. |
boolean |
isOverloaded()
Indicates if the controller is overloaded. |
protected boolean |
isRunning()
Indicates if the task is running. |
void |
run()
Listens on the given server socket for incoming connections. |
void |
setOverloaded(boolean overloaded)
Indicates if the controller is overloaded. |
void |
shutdown()
Abort the controller. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ConnectionHelper<?> helper
protected boolean overloaded
protected boolean running
| Constructor Detail |
|---|
public Controller(ConnectionHelper<?> helper)
helper - The parent connector helper.| Method Detail |
|---|
protected void doInit()
protected void doRelease()
protected void doRun(long sleepTime)
throws IOException
run() to provide an
easy method to overload.
sleepTime - The maximum amount of sleep time.
IOExceptionprotected ConnectionHelper<?> getHelper()
protected ExecutorService getWorkerService()
public boolean isOverloaded()
protected boolean isRunning()
public void run()
public void setOverloaded(boolean overloaded)
overloaded - True if the controller is overloaded.public void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||