com.neeve.daemon.controller
Class DmnController

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.daemon.controller.DmnController
Direct Known Subclasses:
SrvController

public abstract class DmnController
extends RootObject

The daemon controller.

This class is the base class for all daemon controller classes.

Threading:
This class is not safe for concurrent access by multiple threads.

Method Summary
 IDmnControllerEventHandler getEventHandler()
          Get the controller event handler.
 void setEventHandler(IDmnControllerEventHandler eventHandler)
          Set the controller event handler.
 void setLauncher(IDmnControllerLauncher launcher)
          Set the controller launcher interface
 void start()
          Start the daemon.
 void stop()
          Stop the daemon.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setEventHandler

public final void setEventHandler(IDmnControllerEventHandler eventHandler)
Set the controller event handler.

Parameters:
eventHandler - The event handler to set.
Threading:
This method is safe for concurrent access by multiple threads.

This method sets the controller event handler. The daemon controller dispatches its events through this registered handler.

The daemon event handler can only be set before starting the daemon. An attempt to invoke this method after the daemon has been started will result in an IllegalStateException being thrown.


getEventHandler

public final IDmnControllerEventHandler getEventHandler()
Get the controller event handler.

Threading:
This method is safe for concurrent access by multiple threads.

This method gets the installed controller event handler.


setLauncher

public final void setLauncher(IDmnControllerLauncher launcher)
Set the controller launcher interface

Parameters:
launcher - The launcher interface to set.
Threading:
This method is safe for concurrent access by multiple threads.

This method sets the interface of the daemon launcher. The launcher interface is the interface through which the daemon communicates back to the launcher to query for information or perform some tasks.

The daemon launcher interface can only be set before starting the daemon. An attempt to invoke this method after the daemon has been started will result in an IllegalStateException being thrown.


start

public final void start()
Start the daemon.

Threading:
This method is not safe for concurrent access by multiple threads.

This method starts the daemon. The method performs all initializations, kicks off the daemon operation and does not return control until the daemon is stopped via stop().

This method first initializes the thread manager associated with this daemon, invokes the init() method, dispatches the init completion event and then enters the thread manager's start method. Unless an exception is thrown, this method will not return until a corresponding stop() is invoked.


stop

public final void stop()
Stop the daemon.

Threading:
This method is not safe for concurrent access by multiple threads.

This method stops the daemon. The method returns after the daemon operation has successfully been stopped.

This method invokes the shutdown() method and then stops the thread manager. That will stop all operating threads in the daemon. This method will return after the daemon has been successfully stopped.



Copyright © 2015 Neeve Research, LLC. All Rights Reserved.