public abstract class AbstractIoService extends Object implements IoService
IoService
s.Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractIoService.ServiceState
The Service states
|
Modifier and Type | Field and Description |
---|---|
protected IoSessionConfig |
config
the default session configuration
|
protected IoHandlerExecutor |
ioHandlerExecutor
used for executing IoHandler event in another pool of thread (not in the low level I/O one)
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractIoService(IoHandlerExecutor eventExecutor)
Create an AbstractIoService
|
Modifier and Type | Method and Description |
---|---|
protected void |
fireServiceActivated()
Inform all current the listeners of the service activation.
|
protected void |
fireServiceInactivated()
Inform all current the listeners of the service desactivation.
|
IoFilter[] |
getFilters()
Get the list of filters installed on this service
|
IoHandler |
getIoHandler()
Get the
IoHandler in charge of your business logic for this service. |
IoHandlerExecutor |
getIoHandlerExecutor()
Get the
IoHandlerExecutor used for executing IoHandler events in another pool of thread (not in
the low level I/O one). |
Map<Long,IoSession> |
getManagedSessions()
Returns the map of all sessions which are currently managed by this service.
|
protected void |
initState()
Initialize the IoService state
|
boolean |
isActive() |
boolean |
isCreated() |
boolean |
isDisposed() |
boolean |
isDisposing() |
boolean |
isSuspended() |
protected void |
setActive()
Sets the IoService state to ACTIVE.
|
protected void |
setCreated()
Sets the IoService state to CREATED.
|
protected void |
setDisposed()
Sets the IoService state to DISPOSED.
|
protected void |
setDisposing()
Sets the IoService state to DISPOSING.
|
void |
setFilters(IoFilter... filters)
Set the list of filters for this service.
|
void |
setIoHandler(IoHandler handler)
Set the
IoHandler in charge of your business logic for this service. |
protected void |
setSuspended()
Sets the IoService state to SUSPENDED.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSessionConfig
protected IoSessionConfig config
protected final IoHandlerExecutor ioHandlerExecutor
protected AbstractIoService(IoHandlerExecutor eventExecutor)
eventExecutor
- used for executing IoHandler event in another pool of thread (not in the low level I/O one).
Use null
if you don't want one. Be careful, the IoHandler processing will block the I/O
operations.public Map<Long,IoSession> getManagedSessions()
ID
of the session.getManagedSessions
in interface IoService
public void setIoHandler(IoHandler handler)
IoHandler
in charge of your business logic for this service.setIoHandler
in interface IoService
handler
- the handler called for every event of the service (new connections, messages received, etc..)public IoHandler getIoHandler()
IoHandler
in charge of your business logic for this service.getIoHandler
in interface IoService
public IoHandlerExecutor getIoHandlerExecutor()
IoHandlerExecutor
used for executing IoHandler
events in another pool of thread (not in
the low level I/O one).getIoHandlerExecutor
in interface IoService
public boolean isActive()
public boolean isDisposing()
public boolean isDisposed()
public boolean isSuspended()
public boolean isCreated()
protected void setCreated()
protected void setActive()
protected void setDisposed()
protected void setDisposing()
protected void setSuspended()
protected void initState()
protected void fireServiceActivated()
protected void fireServiceInactivated()
public IoFilter[] getFilters()
getFilters
in interface IoService
public void setFilters(IoFilter... filters)
setFilters
in interface IoService
Copyright © 2009–2013 Apache MINA Project. All rights reserved.