public class ConnectionManagerImpl extends AbstractSingleTask<ConnectionManagerImpl,None,None> implements ConnectionManager
EstablishedConnection
instances for the
ServerSocketAccepter
instances across the available
SocketListener
instances.Constructor and Description |
---|
ConnectionManagerImpl(long heartbeatInterval,
SocketListener... socketListeners)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
void |
closeSocketSelectors()
Closes the
Selector instances for managing the
EstablishedConnection instances. |
Object |
doTask(TaskContext<ConnectionManagerImpl,None,None> context)
Does the task.
|
void |
manageConnection(EstablishedConnection connection)
Manages the
EstablishedConnection . |
void |
openSocketSelectors()
Opens the
Selector instances for managing the
EstablishedConnection instances. |
createTask, createWork, getRecycleManagedObjectParameter, registerAsRecycleTask, registerTask, registerTask, registerTask, registerWork
public ConnectionManagerImpl(long heartbeatInterval, SocketListener... socketListeners)
heartbeatInterval
- Heart beat interval in milliseconds.socketListeners
- Available SocketListener
instances.public void openSocketSelectors() throws IOException
ConnectionManager
Selector
instances for managing the
EstablishedConnection
instances.openSocketSelectors
in interface ConnectionManager
IOException
- If fails to open all the Selector
instances.public void manageConnection(EstablishedConnection connection)
ConnectionManager
EstablishedConnection
.manageConnection
in interface ConnectionManager
connection
- EstablishedConnection
to be managed.public void closeSocketSelectors() throws IOException
ConnectionManager
Selector
instances for managing the
EstablishedConnection
instances.closeSocketSelectors
in interface ConnectionManager
IOException
- If fails to close Selector
instances.public Object doTask(TaskContext<ConnectionManagerImpl,None,None> context) throws Throwable
Task
doTask
in interface Task<ConnectionManagerImpl,None,None>
context
- TaskContext
for the Task
.Task
. This allows stringing
Task
instances together into a JobSequence
.Throwable
- Indicating failure of the Task
.Copyright © 2005–2016. All rights reserved.