org.opennms.netmgt.daemon
Class AbstractServiceDaemon

java.lang.Object
  extended by org.opennms.netmgt.daemon.AbstractServiceDaemon
All Implemented Interfaces:
org.opennms.core.fiber.Fiber, org.opennms.core.fiber.PausableFiber, SpringServiceDaemon, org.opennms.netmgt.model.ServiceDaemon, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
Actiond, Capsd, Collectd, Dhcpd, Discovery, Eventd, EventTranslator, Linkd, Notifd, PassiveStatusKeeper, Poller, Queued, RTCManager, Scriptd, Syslogd, Threshd, Trapd, Vacuumd, Vulnscand, Xmlrpcd

public abstract class AbstractServiceDaemon
extends Object
implements org.opennms.netmgt.model.ServiceDaemon, SpringServiceDaemon


Field Summary
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
protected AbstractServiceDaemon(String name)
           
 
Method Summary
 void afterPropertiesSet()
           
 String getName()
           
 int getStatus()
           
 String getStatusText()
           
 void init()
           
protected  boolean isPaused()
           
protected  boolean isRunning()
           
protected  boolean isStarting()
           
protected  boolean isStartPending()
           
protected  Category log()
           
protected abstract  void onInit()
           
protected  void onPause()
           
protected  void onResume()
           
protected  void onStart()
           
protected  void onStop()
           
 void pause()
           
 void resume()
           
protected  void setStatus(int status)
           
 void start()
           
 String status()
           
 void stop()
          Stops the currently running service.
protected  void waitForStatus(int status)
           
protected  void waitForStatus(int status, long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractServiceDaemon

protected AbstractServiceDaemon(String name)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

onInit

protected abstract void onInit()

onPause

protected void onPause()

onResume

protected void onResume()

onStart

protected void onStart()

onStop

protected void onStop()

getName

public final String getName()
Specified by:
getName in interface org.opennms.core.fiber.Fiber

setStatus

protected void setStatus(int status)

waitForStatus

protected void waitForStatus(int status,
                             long timeout)
                      throws InterruptedException
Throws:
InterruptedException

waitForStatus

protected void waitForStatus(int status)
                      throws InterruptedException
Throws:
InterruptedException

getStatus

public int getStatus()
Specified by:
getStatus in interface org.opennms.core.fiber.Fiber

getStatusText

public String getStatusText()

status

public String status()
Specified by:
status in interface org.opennms.netmgt.model.ServiceDaemon

isStartPending

protected boolean isStartPending()

isRunning

protected boolean isRunning()

isPaused

protected boolean isPaused()

isStarting

protected boolean isStarting()

log

protected Category log()

init

public final void init()

pause

public final void pause()
Specified by:
pause in interface org.opennms.core.fiber.PausableFiber

resume

public final void resume()
Specified by:
resume in interface org.opennms.core.fiber.PausableFiber

start

public final void start()
Specified by:
start in interface org.opennms.core.fiber.Fiber
Specified by:
start in interface SpringServiceDaemon

stop

public final void stop()
Stops the currently running service. If the service is not running then the command is silently discarded.

Specified by:
stop in interface org.opennms.core.fiber.Fiber


Copyright ? 2007. All Rights Reserved.