Constructor and Description |
---|
Controller(BaseHelper<?> helper)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
controlConnections()
Control each connection for messages to read or write.
|
protected void |
controlHelper()
Control the helper for inbound or outbound messages to handle.
|
protected void |
execute(Runnable task)
Executes the next task in a separate thread provided by the worker
service, only if the worker service isn't busy.
|
protected BaseHelper<?> |
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 |
isWorkerServiceFull()
Indicates if the helper's worker service is fully busy and can't accept
more tasks.
|
void |
run()
Listens on the given server socket for incoming connections.
|
void |
setOverloaded(boolean overloaded)
Indicates if the controller is overloaded.
|
isRunning, setRunning
public Controller(BaseHelper<?> helper)
helper
- The parent connector helper.protected void controlConnections() throws IOException
IOException
protected void controlHelper()
protected void execute(Runnable task)
task
- The next task to execute.protected BaseHelper<?> getHelper()
protected ExecutorService getWorkerService()
public boolean isOverloaded()
protected boolean isWorkerServiceFull()
public void run()
public void setOverloaded(boolean overloaded)
overloaded
- True if the controller is overloaded.Copyright © 2005–2016. All rights reserved.