public abstract class Daemon extends Object
| Modifier and Type | Field and Description | 
|---|---|
| protected static char[] | hexArray | 
| Constructor and Description | 
|---|
| Daemon()Constructs the Daemon. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addListener(DaemonListener listener) | 
| void | addShutdownHook(Runnable r) | 
| 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. | 
| List<DaemonListener> | getDaemonListeners() | 
| Throwable | getLastError()If startup failed get the last error. | 
| static Date | getReleaseDate()Returns the release date of the current version. | 
| static String | getVersion()Returns the current version of the API. | 
| boolean | isStarted()Get whether the daemon is currently started | 
| boolean | isStarting() | 
| 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) | 
| void | registerHandler(SocketHandler handler,
               SelectableChannel channel,
               ProtocolEngine engine)Register a socket handler with the daemon. | 
| void | registerHandler(SocketHandler handler,
               SelectableChannel channel,
               SelectorThread thread) | 
| void | registerHandler(SocketHandler handler,
               SelectableChannel channel,
               SelectorThread thread,
               ProtocolEngine engine)Register a socket handler with the daemon. | 
| void | removeAcceptor(ListeningInterface li) | 
| void | removeListener(DaemonListener listener) | 
| void | restart() | 
| void | restart(boolean graceful,
       long forceAfterMs) | 
| void | shutdownAsync(boolean graceful,
             long forceAfterMs)Shutdown the server. | 
| void | shutdownNow(boolean graceful,
           long forceAfterMs)This method should be used to shutdown the server from your main thread. | 
| boolean | startAcceptingConnections(boolean propagateErrors) | 
| protected boolean | startListeningInterface(ListeningInterface li,
                       boolean propagateErrors) | 
| boolean | startup()Starts the daemon, first calling the
  #configure(ConfigurationContext)method to allow your server to
 configure itself. | 
| boolean | startup(boolean propagateErrors)Starts the daemon, first calling the
  #configure(ConfigurationContext)method to allow your server to
 configure itself. | 
| void | stopAcceptingConnections() | 
public DaemonContext getContext()
public static String getVersion()
public static Date getReleaseDate()
public boolean isStarting()
public void addShutdownHook(Runnable r)
public boolean startup()
                throws IOException
#configure(ConfigurationContext) method to allow your server to
 configure itself.IOExceptionpublic boolean startup(boolean propagateErrors)
                throws IOException
#configure(ConfigurationContext) method to allow your server to
 configure itself.propagate - Do not consume errors.IOExceptionpublic boolean startAcceptingConnections(boolean propagateErrors)
                                  throws IOException
IOExceptionpublic Throwable getLastError()
protected boolean startListeningInterface(ListeningInterface li, boolean propagateErrors) throws IOException
IOExceptionpublic void removeAcceptor(ListeningInterface li)
public boolean isStarted()
public void shutdownAsync(boolean graceful,
                          long forceAfterMs)
public void shutdownNow(boolean graceful,
                        long forceAfterMs)
shutdownAsync().public void stopAcceptingConnections()
public void restart()
             throws IOException
IOExceptionpublic void restart(boolean graceful,
                    long forceAfterMs)
             throws IOException
IOExceptionpublic void registerConnector(ClientConnector connector, SocketChannel socketChannel) throws IOException
connector - ClientConnectorsocketChannel - SocketChannelIOExceptionpublic void registerAcceptor(ClientAcceptor acceptor, ServerSocketChannel socketChannel) throws IOException
acceptor - ClientAcceptorsocketChannel - ServerSocketChannelIOExceptionpublic void registerHandler(SocketHandler handler, SelectableChannel channel, ProtocolEngine engine) throws IOException
handler - SocketHandlerchannel - SelectableChannelIOExceptionpublic void registerHandler(SocketHandler handler, SelectableChannel channel) throws IOException
IOExceptionpublic void registerHandler(SocketHandler handler, SelectableChannel channel, SelectorThread thread, ProtocolEngine engine) throws IOException
handler - SocketHandlerchannel - SelectableChannelthread - SelectorThreadIOExceptionpublic void registerHandler(SocketHandler handler, SelectableChannel channel, SelectorThread thread) throws IOException
IOExceptionprotected abstract void configure(DaemonContext context) throws IOException, SshException
context - IOExceptionSshExceptionpublic List<DaemonListener> getDaemonListeners()
public void addListener(DaemonListener listener)
public void removeListener(DaemonListener listener)
Copyright © 2025. All rights reserved.