au.gov.tas.dpiwe.mr.server.daemon
Interface ServerDaemonContainer

All Known Implementing Classes:
ClientContainer, CommandInterpreter, DaemonContainer, DatabaseBackedContainer, DeploymentContainer, LightweightContainer, SafeCache, ServerContainer, ServerContainer

public interface ServerDaemonContainer

A server daemon container encapsulates a group of ServerDaemons.

Since:
Mr Architecture 1.8
Version:
1.0.0.9
Author:
Kade Hansson

Method Summary
 ServerDaemon addDaemon(String name, ServerDaemon serverDaemon)
          Adds a recognised daemon to this container and initializes it through its init() method.
 ServerDaemon addDaemon(String name, ServerDaemon daemon, boolean autoStart)
          Adds a recognised daemon to this container, initializes it through its init() method and possibly schedules it to be automatically started.
 void autoStartDaemons()
          Starts daemons which have been scheduled to be automatically started.
 void beginAtom()
          Called by a server daemon to indicate that it is about to begin processing a new atom which should have its log messages grouped together.
 void closeLog()
          Closes the log of the currently executing server daemon.
 StartResponse doStartCommand(String name)
          Start a local daemon by calling its start method().
 StopResponse doStopCommand(String name)
          Stop a local daemon by calling its stop method().
 void endAtom()
          Called by a server daemon to indicate that it has completed processing an atom which should have its log messages grouped together.
 Set getKilledDaemonNames()
           
 Set getRunningDaemonNames()
           
 void killDaemonsImmediate()
           
 void resetClock()
          Resets the clock on a running daemon.
 void shutdown()
          Terminates all running daemons by calling stop(), then finalizes all registered daemons through their destroy() methods.
 StartResponse startDaemon(String name)
          Starts a daemon running on the server by calling its start() method.
 StopResponse stopDaemon(String name)
          Stops a daemon running on the server by calling its stop() method.
 

Method Detail

autoStartDaemons

void autoStartDaemons()
Starts daemons which have been scheduled to be automatically started.


addDaemon

ServerDaemon addDaemon(String name,
                       ServerDaemon serverDaemon)
Adds a recognised daemon to this container and initializes it through its init() method.

This method is called by external clients to inform the container of each daemon it needs to service.

Parameters:
name - a name through which external clients may refer to the daemon.
daemon - the daemon object.
Returns:
the daemon object.

addDaemon

ServerDaemon addDaemon(String name,
                       ServerDaemon daemon,
                       boolean autoStart)
Adds a recognised daemon to this container, initializes it through its init() method and possibly schedules it to be automatically started.

This method is called by external clients to inform the container of each daemon it needs to service.

Parameters:
name - a name through which external clients may refer to the daemon.
daemon - the daemon object.
autoStart - true to schedule the daemon to be automatically started, false otherwise.
Returns:
the daemon object.

startDaemon

StartResponse startDaemon(String name)
                          throws EJBException
Starts a daemon running on the server by calling its start() method.

Parameters:
name - the name of the daemon to start.
Throws:
EJBException - the daemon refused to start, the current user has insufficient priveleges to start the daemon or a communication breakdown occurred.

stopDaemon

StopResponse stopDaemon(String name)
                        throws EJBException
Stops a daemon running on the server by calling its stop() method.

Parameters:
name - the name of the daemon to stop.
Throws:
EJBException - the daemon refused to stop, the current user has insufficient priveleges to stop the daemon or a communication breakdown occurred.

doStartCommand

StartResponse doStartCommand(String name)
Start a local daemon by calling its start method().

This method is not intended to be used by external clients. Call startDaemon() instead.

Parameters:
name - the name of the daemon to stop.
Returns:
the start response.
Throws:
EJBException - the daemon refused to stop, the current user has insufficient priveleges to stop the daemon or a communication breakdown occurred.

doStopCommand

StopResponse doStopCommand(String name)
Stop a local daemon by calling its stop method().

This method is not intended to be used by external clients. Call stopDaemon() instead.

Parameters:
name - the name of the daemon to stop.
Returns:
the stop response.
Throws:
EJBException - the daemon refused to stop, the current user has insufficient priveleges to stop the daemon or a communication breakdown occurred.

resetClock

void resetClock()
Resets the clock on a running daemon. Used in daemons where the real time at which atom is processed is more important than the total elapsed time of the daemon, called before each atom is processed.


beginAtom

void beginAtom()
Called by a server daemon to indicate that it is about to begin processing a new atom which should have its log messages grouped together.


endAtom

void endAtom()
Called by a server daemon to indicate that it has completed processing an atom which should have its log messages grouped together.


shutdown

void shutdown()
Terminates all running daemons by calling stop(), then finalizes all registered daemons through their destroy() methods.


closeLog

void closeLog()
Closes the log of the currently executing server daemon.


killDaemonsImmediate

void killDaemonsImmediate()

getKilledDaemonNames

Set getKilledDaemonNames()

getRunningDaemonNames

Set getRunningDaemonNames()