org.isam.exehda.services.ctxm
Class ContextChain

java.lang.Object
  |
  +--org.isam.exehda.services.ctxm.ContextChain
Direct Known Subclasses:
SingleSensorChainDouble

abstract class ContextChain
extends java.lang.Object

Abstract class representing a filter that produces context information from raw sensor data. ContextChains are built through the getInstance() which expects as parameter a context element definition in XML.

Version:
$Date: 2004/12/31 21:19:21 $ $Revision: 1.3 $
Author:
last modified by $Author: lucc $
To do:
specify the XML context defition format.

Constructor Summary
(package private) ContextChain()
           
 
Method Summary
static ContextChain getInstance(java.lang.String ctxDef)
          Creates a new ContextChain.
static void setChainFactory(ContextChainFactory f)
          Installs a new chain factory.
abstract  ContextEvent updateChain(Environment env, long tsNow)
          Notifies the chain that the current environment has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextChain

ContextChain()
Method Detail

setChainFactory

public static void setChainFactory(ContextChainFactory f)
Installs a new chain factory.

Parameters:
f - a non-null ContextChainFactory value

getInstance

public static ContextChain getInstance(java.lang.String ctxDef)
Creates a new ContextChain. This is done by invoking createChain() in the currently configured factory.

Parameters:
ctxDef - a String value
Returns:
a ContextChain value

updateChain

public abstract ContextEvent updateChain(Environment env,
                                         long tsNow)
Notifies the chain that the current environment has changed. The chain should update the current context element state accordingly and return an event in the case it has detected a change in the context element state. If the state of the context element has not changed, null must be returned.

Parameters:
env - an Environment value
tsNow - a time stamp to be used with the generated context event
Returns:
a ContextEvent value or null if the state of the context element has not changed.