eu.xtreemos.xosd.daemon
Class DaemonGlobal

java.lang.Object
  extended by eu.xtreemos.system.eventmachine.stage.AbstractStage
      extended by eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
          extended by eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
              extended by eu.xtreemos.xosd.daemon.Daemon
                  extended by eu.xtreemos.xosd.daemon.service.DaemonHandler
                      extended by eu.xtreemos.xosd.daemon.DaemonGlobal
All Implemented Interfaces:
eu.xtreemos.system.eventmachine.queue.IEventHandler, eu.xtreemos.system.eventmachine.stage.IStage

public class DaemonGlobal
extends eu.xtreemos.xosd.daemon.service.DaemonHandler

Author:
gregor.pipan@xlab.si

Field Summary
protected  boolean amServer
          Set by the init() to true if this daemon is at the root address, and false otherwise.
static org.apache.log4j.Logger logger
           
protected  java.lang.String[] methodsForRelay
          List of methods that need to be relayed to the root.
 
Fields inherited from class eu.xtreemos.xosd.daemon.Daemon
runningStages, serviceDir
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
context, counter, curContext, sink
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
queue
 
Fields inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage
handlerChain, handlerGroup, handlerThreads, name, running, serviceListeners
 
Constructor Summary
DaemonGlobal()
           
 
Method Summary
 void addRunningService(eu.xtreemos.system.eventmachine.stage.AbstractStage source)
           
 void handleEvent(java.lang.Object event)
           
 void init()
           
protected  boolean isMessageForRelay(java.lang.String method)
          Check whether the method is on the list for the relaying to the root daemon, represented by methodsForRelay.
 void removeRunningService(eu.xtreemos.system.eventmachine.stage.AbstractStage source)
           
 
Methods inherited from class eu.xtreemos.xosd.daemon.service.DaemonHandler
getHandledEventType
 
Methods inherited from class eu.xtreemos.xosd.daemon.Daemon
finishKill, getDaemons, getNodesRunningService, getServiceList, kill, registerDaemon, registerDaemonCallback, registerMyServices, registerServices, removeRegisteredServices, unregisterDaemon
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.Abstract2wayStage
getContext, removeContext, SendException, SendException, SendException, SendReply, SendReply, SendReply, setSink
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractReceivingStage
dequeue, getSource
 
Methods inherited from class eu.xtreemos.system.eventmachine.stage.AbstractStage
addHandler, addHandler, addServiceListener, getName, getShortName, getThreadCount, notifyServiceInitialised, notifyServiceStarted, notifyServiceStopped, processEvent, removeHandler, removeServiceListener, setThreadCount, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final org.apache.log4j.Logger logger

methodsForRelay

protected java.lang.String[] methodsForRelay
List of methods that need to be relayed to the root.


amServer

protected boolean amServer
Set by the init() to true if this daemon is at the root address, and false otherwise. The value regulates whether the service actually performs the action of certain calls here or at the root address. The method names are listed by methodsForRelay.

Constructor Detail

DaemonGlobal

public DaemonGlobal()
Method Detail

isMessageForRelay

protected boolean isMessageForRelay(java.lang.String method)
Check whether the method is on the list for the relaying to the root daemon, represented by methodsForRelay.

Parameters:
method - The name of the method to check.
Returns:
True if the method is to be relayed, and false otherwise.

handleEvent

public void handleEvent(java.lang.Object event)
                 throws java.lang.Exception
Specified by:
handleEvent in interface eu.xtreemos.system.eventmachine.queue.IEventHandler
Overrides:
handleEvent in class eu.xtreemos.xosd.daemon.service.DaemonHandler
Throws:
java.lang.Exception

init

public void init()
Specified by:
init in interface eu.xtreemos.system.eventmachine.stage.IStage
Overrides:
init in class Daemon

addRunningService

public void addRunningService(eu.xtreemos.system.eventmachine.stage.AbstractStage source)

removeRunningService

public void removeRunningService(eu.xtreemos.system.eventmachine.stage.AbstractStage source)