|
|||||||||
| 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. |
static java.util.Date |
getReleaseDate()
Returns the release date of the current version. |
static java.lang.String |
getVersion()
Returns the current version of the API. |
boolean |
isStarted()
Get whether the daemon is currently started |
boolean |
isStarting()
|
void |
registerAcceptor(ClientAcceptor acceptor,
java.nio.channels.ServerSocketChannel socketChannel)
Register a client acceptor with the daemon. |
void |
registerConnector(ClientConnector connector,
java.nio.channels.SocketChannel socketChannel)
Register a client connector with the daemon. |
void |
registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel)
Register a socket handler with the daemon. |
void |
registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel,
SelectorThread thread)
Register a socket handler with the daemon. |
void |
removeAcceptor(ListeningInterface li)
|
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 static java.lang.String getVersion()
public static java.util.Date getReleaseDate()
public boolean isStarting()
public boolean startup()
throws java.io.IOException
#configure(ConfigurationContext)
method to allow your server to configure itself.
java.io.IOException
protected boolean startListeningInterface(ListeningInterface li)
throws java.io.IOException
java.io.IOExceptionpublic void removeAcceptor(ListeningInterface li)
public boolean isStarted()
public void shutdown()
public void registerConnector(ClientConnector connector,
java.nio.channels.SocketChannel socketChannel)
throws java.io.IOException
connector - ClientConnectorsocketChannel - SocketChannel
java.io.IOException
public void registerAcceptor(ClientAcceptor acceptor,
java.nio.channels.ServerSocketChannel socketChannel)
throws java.io.IOException
acceptor - ClientAcceptorsocketChannel - ServerSocketChannel
java.io.IOException
public void registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel)
throws java.io.IOException
handler - SocketHandlerchannel - SelectableChannel
java.io.IOException
public void registerHandler(SocketHandler handler,
java.nio.channels.SelectableChannel channel,
SelectorThread thread)
throws java.io.IOException
handler - SocketHandlerchannel - SelectableChannelthread - SelectorThread
java.io.IOException
protected abstract void configure(DaemonContext context)
throws java.io.IOException
context -
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||