com.eurotech.framework.linux.watchdog
Class WatchdogServiceImpl

java.lang.Object
  extended by com.eurotech.framework.linux.watchdog.WatchdogServiceImpl
All Implemented Interfaces:
ConfigurableComponent, WatchdogService

public class WatchdogServiceImpl
extends Object
implements WatchdogService, ConfigurableComponent


Constructor Summary
WatchdogServiceImpl()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext, Map<String,Object> properties)
           
 void checkin(CriticalComponent criticalService)
          This method is used to notify the Watchdog Service that a critical service has 'checked in' and the reboot timer should be reset.
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
           
 List<CriticalComponent> getCriticalComponents()
          Returns the list of the currently registered CriticalComponents
 int getHardwareTimeout()
          Returns the timeout value for the hardware watchdog in increments of milliseconds.
 boolean isConfigEnabled()
           
 void registerCriticalService(CriticalComponent criticalComponent)
          Register a critical service with the Critical Service Check-in.
 void setConfigEnabled(boolean configEnabled)
           
 void startWatchdog()
          Starts the hardware watchdog on the device.
 void stopWatchdog()
          Stops the hardware Watchdog on the device
 void unregisterCriticalService(CriticalComponent criticalComponent)
          Unregister a critical service with the Critical Service Check-in.
 void updated(Map<String,Object> properties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WatchdogServiceImpl

public WatchdogServiceImpl()
Method Detail

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext,
                        Map<String,Object> properties)

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)

updated

public void updated(Map<String,Object> properties)

startWatchdog

public void startWatchdog()
Description copied from interface: WatchdogService
Starts the hardware watchdog on the device. If a timeout value has not been set, the watchdog will use its default timeout.

Specified by:
startWatchdog in interface WatchdogService

stopWatchdog

public void stopWatchdog()
Description copied from interface: WatchdogService
Stops the hardware Watchdog on the device

Specified by:
stopWatchdog in interface WatchdogService

getHardwareTimeout

public int getHardwareTimeout()
Description copied from interface: WatchdogService
Returns the timeout value for the hardware watchdog in increments of milliseconds.

Specified by:
getHardwareTimeout in interface WatchdogService
Returns:
An int representing the hardware timeout value in milliseconds.

registerCriticalService

public void registerCriticalService(CriticalComponent criticalComponent)
Description copied from interface: WatchdogService
Register a critical service with the Critical Service Check-in. Once registered, the critical service must call the checkin() method (at a frequency higher than 1/timeout) to prevent a system reboot.

Specified by:
registerCriticalService in interface WatchdogService

unregisterCriticalService

public void unregisterCriticalService(CriticalComponent criticalComponent)
Description copied from interface: WatchdogService
Unregister a critical service with the Critical Service Check-in. Once unregistered, the critical service will no longer call the checkin() method.

Specified by:
unregisterCriticalService in interface WatchdogService

getCriticalComponents

public List<CriticalComponent> getCriticalComponents()
Description copied from interface: WatchdogService
Returns the list of the currently registered CriticalComponents

Specified by:
getCriticalComponents in interface WatchdogService
Returns:
A List of CriticalComponents

checkin

public void checkin(CriticalComponent criticalService)
Description copied from interface: WatchdogService
This method is used to notify the Watchdog Service that a critical service has 'checked in' and the reboot timer should be reset.

Specified by:
checkin in interface WatchdogService
Parameters:
criticalService - A criticalService to be updated.

isConfigEnabled

public boolean isConfigEnabled()

setConfigEnabled

public void setConfigEnabled(boolean configEnabled)


Copyright © 2013. All Rights Reserved.