org.isam.exehda.services.ctxm
Class CtxManagerImplNode
java.lang.Object
|
+--org.isam.exehda.services.AbstractService
|
+--org.isam.exehda.services.ctxm.CtxManagerImplNode
- All Implemented Interfaces:
- Collector.MonitoringConsumer, ContextManager, java.lang.Runnable, Service
- public class CtxManagerImplNode
- extends AbstractService
- implements ContextManager, Collector.MonitoringConsumer, java.lang.Runnable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CtxManagerImplNode
public CtxManagerImplNode()
start
public void start()
- Specified by:
start
in interface Service
stop
public void stop()
- Specified by:
stop
in interface Service
createContext
public ContextManager.Context createContext(java.lang.String xmlDesc)
- Description copied from interface:
ContextManager
- Creates/registers a new context element.
The context manager is responsible for allocating resources and enabling the
necessary sensor to produce that context information.
Sample context definition:
<context n="context1">
<states>
<state n="stt1"/>
<state n="stt2"/>
<state n="stt3"/>
</states>
<index>
<switch>
<sensor n="s1" scale="10.0"/>
<sensor n="s2" scale="3.3" />
<composite type="sum">
<sensor n="s1" scale="10.0"/>
<sensor n="s2" scale="3.3" />
</composite>
</switch>
</index>
<ranges>
<range ub="-1" state="stt1"/>
<range lb="-1" ub="1" state="stt2"/>
<range lb="1" state="stt3"/>
<default state="stt1"/>
</ranges>
</context>
- Specified by:
createContext
in interface ContextManager
- Parameters:
xmlDesc
- a String
value
- Returns:
- a
Context
value
releaseContext
public void releaseContext(ContextManager.Context ctx)
- Description copied from interface:
ContextManager
- Notifies the ContextManager that the given context element is not needed
anymore.
The ContextManager is allowed to release resources used to produce that
context information.
- Specified by:
releaseContext
in interface ContextManager
- Parameters:
ctx
- a Context
value
addContextListener
public void addContextListener(ContextManager.ContextListener l,
ContextManager.Context ctx)
- Description copied from interface:
ContextManager
- Registers a listener for events on the given context element.
- Specified by:
addContextListener
in interface ContextManager
- Parameters:
l
- the call backctx
- the context element of interest
removeContextListener
public void removeContextListener(ContextManager.ContextListener l,
ContextManager.Context ctx)
- Description copied from interface:
ContextManager
- Removes a previously registered context listener.
- Specified by:
removeContextListener
in interface ContextManager
- Parameters:
l
- a ContextListener
valuectx
- a Context
value
update
public void update(long timeStamp,
Collector.MonitoringData[] data)
- Callback for monitoring data (from
MonitoringConsumer
interface.
- Specified by:
update
in interface Collector.MonitoringConsumer
- Parameters:
timeStamp
- a long
valuedata
- a MonitoringData[]
value
run
public void run()
- ContextManager's main thread.
- Specified by:
run
in interface java.lang.Runnable