|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Context Recognition Service.
The ContextManager takes as input a context definition in XML. It then proceeds
registering itself within the Collector service and accomplishing any necessary sensor
parameter configuration.
The raw-level data gathered from the collector's sensors is then filtered in order to
produce high-level context information.
The whole application execution context is built up from a a set of context elements
(Context
objects) and its associated states (ContextState
objects).
Nested Class Summary | |
static class |
ContextManager.Context
Represents a context element. |
static interface |
ContextManager.ContextListener
Call-back interface for receiving context element change events. |
static class |
ContextManager.ContextState
Describes a context element's state. |
Field Summary | |
static java.lang.String |
SERVICE_NAME
|
Method Summary | |
void |
addContextListener(ContextManager.ContextListener l,
ContextManager.Context ctx)
Registers a listener for events on the given context element. |
ContextManager.Context |
createContext(java.lang.String xmlDesc)
Creates/registers a new context element. |
void |
releaseContext(ContextManager.Context ctx)
Notifies the ContextManager that the given context element is not needed anymore. |
void |
removeContextListener(ContextManager.ContextListener l,
ContextManager.Context ctx)
Removes a previously registered context listener. |
Field Detail |
public static final java.lang.String SERVICE_NAME
Method Detail |
public ContextManager.Context createContext(java.lang.String xmlDesc)
<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>
xmlDesc
- a String
value
Context
valuepublic void releaseContext(ContextManager.Context ctx)
ctx
- a Context
valuepublic void addContextListener(ContextManager.ContextListener l, ContextManager.Context ctx)
l
- the call backctx
- the context element of interestpublic void removeContextListener(ContextManager.ContextListener l, ContextManager.Context ctx)
l
- a ContextListener
valuectx
- a Context
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |