|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.maverick.nio.Daemon
public abstract class Daemon
This class provides an abstract daemon for servicing any number of protocol contexts.
| Constructor Summary | |
|---|---|
Daemon()
Constructs the Daemon. |
|
| Method Summary | |
|---|---|
protected abstract void |
configure(DaemonContext context)
Called before the server is started so that you can configure the server to your own requirements. |
DaemonContext |
getContext()
Get the context for this Daemon. |
EventService |
getEventService()
Get the event service this daemon uses. |
boolean |
isStarted()
Get whether the daemon is currently started |
protected void |
onShutdown()
|
protected void |
onStart()
|
void |
registerAcceptor(ClientAcceptor acceptor,
ServerSocketChannel socketChannel)
Register a client acceptor with the daemon. |
void |
registerConnector(ClientConnector connector,
SocketChannel socketChannel)
Register a client connector with the daemon. |
void |
registerHandler(SocketHandler handler,
SelectableChannel channel)
Register a socket handler with the daemon. |
void |
registerHandler(SocketHandler handler,
SelectableChannel channel,
SelectorThread thread)
Register a socket handler with the daemon. |
void |
removeAcceptor(ListeningInterface li)
|
void |
setEventService(EventService eventService)
Set the event service this daemon uses. |
void |
shutdown()
Shutdown the server. |
protected boolean |
startListeningInterface(ListeningInterface li)
|
boolean |
startup()
Starts the daemon, first calling the #configure(ConfigurationContext) method to allow your server to
configure itself. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Daemon()
| Method Detail |
|---|
public DaemonContext getContext()
public EventService getEventService()
public void setEventService(EventService eventService)
eventService - event service
public boolean startup()
throws IOException
#configure(ConfigurationContext) method to allow your server to
configure itself.
IOException
protected void onStart()
throws IOException
IOException
protected boolean startListeningInterface(ListeningInterface li)
throws IOException
IOExceptionpublic void removeAcceptor(ListeningInterface li)
public boolean isStarted()
public void shutdown()
protected void onShutdown()
public void registerConnector(ClientConnector connector,
SocketChannel socketChannel)
throws IOException
connector - ClientConnectorsocketChannel - SocketChannel
IOException
public void registerAcceptor(ClientAcceptor acceptor,
ServerSocketChannel socketChannel)
throws IOException
acceptor - ClientAcceptorsocketChannel - ServerSocketChannel
IOException
public void registerHandler(SocketHandler handler,
SelectableChannel channel)
throws IOException
handler - SocketHandlerchannel - SelectableChannel
IOException
public void registerHandler(SocketHandler handler,
SelectableChannel channel,
SelectorThread thread)
throws IOException
handler - SocketHandlerchannel - SelectableChannelthread - SelectorThread
IOException
protected abstract void configure(DaemonContext context)
throws IOException
context -
IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||