com.maverick.nio
Class Daemon<T extends ProtocolContext>

java.lang.Object
  extended by com.maverick.nio.Daemon<T>

public abstract class Daemon<T extends ProtocolContext>
extends Object


Field Summary
protected  ProtocolContextFactory<T> contextFactory
           
protected  DaemonContext<T> daemonContext
           
protected  org.apache.mina.core.service.IoAcceptor ioAcceptor
           
 
Constructor Summary
Daemon()
           
Daemon(ProtocolContextFactory<T> contextFactory)
           
 
Method Summary
protected abstract  void configure(DaemonContext<T> daemonContext)
           
protected  org.apache.mina.core.service.IoAcceptor createAcceptor(DaemonContext<T> daemonContext)
           
protected  org.apache.mina.core.service.IoAcceptor createIoAcceptor(DaemonContext<T> daemonContext)
           
 DaemonContext<T> getContext()
           
 EventService getEventService()
           
static Date getReleaseDate()
          Returns the release date of the current version.
static String getVersion()
          Returns the current version of the API.
 boolean isStarted()
           
 boolean isStarting()
           
 void onShutdown()
           
 void onStart()
           
protected  void postStartup()
          Invoked after startup, for subclasses to override.
protected  void preStartup()
          Invoked before startup, for subclasses to override.
 void setContextFactory(ProtocolContextFactory<T> contextFactory)
           
 void shutdown()
           
 boolean startListeningInterface(InetAddress addressToBind, int portToBind)
           
 boolean startup()
           
 void stopListeningInterface(InetAddress addressToBind, int portToBind)
           
protected abstract  boolean verifyStartup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ioAcceptor

protected org.apache.mina.core.service.IoAcceptor ioAcceptor

contextFactory

protected ProtocolContextFactory<T extends ProtocolContext> contextFactory

daemonContext

protected DaemonContext<T extends ProtocolContext> daemonContext
Constructor Detail

Daemon

public Daemon(ProtocolContextFactory<T> contextFactory)

Daemon

public Daemon()
Method Detail

setContextFactory

public void setContextFactory(ProtocolContextFactory<T> contextFactory)

getEventService

public EventService getEventService()

getVersion

public static String getVersion()
Returns the current version of the API.


getReleaseDate

public static Date getReleaseDate()
Returns the release date of the current version.


startup

public final boolean startup()
                      throws IOException
Throws:
IOException

verifyStartup

protected abstract boolean verifyStartup()

shutdown

public void shutdown()

configure

protected abstract void configure(DaemonContext<T> daemonContext)
                           throws IOException
Throws:
IOException

getContext

public DaemonContext<T> getContext()

startListeningInterface

public boolean startListeningInterface(InetAddress addressToBind,
                                       int portToBind)

stopListeningInterface

public void stopListeningInterface(InetAddress addressToBind,
                                   int portToBind)

createAcceptor

protected org.apache.mina.core.service.IoAcceptor createAcceptor(DaemonContext<T> daemonContext)

createIoAcceptor

protected org.apache.mina.core.service.IoAcceptor createIoAcceptor(DaemonContext<T> daemonContext)

preStartup

protected void preStartup()
Invoked before startup, for subclasses to override.


postStartup

protected void postStartup()
Invoked after startup, for subclasses to override.


isStarted

public boolean isStarted()

isStarting

public boolean isStarting()

onStart

public void onStart()
             throws IOException
Throws:
IOException

onShutdown

public void onShutdown()


Copyright © 2012. All Rights Reserved.