de.fhg.igd.jhsm
Class HSMContext

java.lang.Object
  extended byde.fhg.igd.jhsm.HSMContext
All Implemented Interfaces:
Context, Serializable

public class HSMContext
extends Object
implements Context, Serializable

A generic context.

Version:
"$Id: HSMContext.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Haevecker
See Also:
Serialized Form

Field Summary
private  Map dataStore_
          A general purpose data container that can be used by actions to share information.
private  EventBus dispatcher_
          The event dispatcher associated with the hsm to which the context belongs.
private  Event trigger_
          Some actions are performed because a trigger event has been received.
 
Constructor Summary
HSMContext()
           
 
Method Summary
 Object get(String key)
          Returns the object that was associated with a given context key.
 EventBus getEventDispatcher()
          Returns the event dispatcher associated with the hsm to which the context belongs.
 Event getTriggerEvent()
          Returns the trigger event.
 Object remove(String key)
           
 void set(String key, Object value)
          Associates the specified value with the specified key in the context.
 void setEventDispatcher(EventBus dispatcher)
          Sets the event dispatcher associated with the hsm to which the context belongs.
 void setTriggerEvent(Event trigger)
          Sets the trigger event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataStore_

private Map dataStore_
A general purpose data container that can be used by actions to share information.


dispatcher_

private EventBus dispatcher_
The event dispatcher associated with the hsm to which the context belongs. We don't use the data conatiner for better performance.


trigger_

private Event trigger_
Some actions are performed because a trigger event has been received. We don't use the data conatiner for better performance.

Constructor Detail

HSMContext

public HSMContext()
Method Detail

get

public Object get(String key)
Description copied from interface: Context
Returns the object that was associated with a given context key.

Specified by:
get in interface Context
Parameters:
key - The key whose associated value is to be returned.
Returns:
The requested object or null if the context contains no mapping for this key.

set

public void set(String key,
                Object value)
Description copied from interface: Context
Associates the specified value with the specified key in the context. If the context previously contained a mapping for this key, the old value is replaced by the specified value.

Specified by:
set in interface Context
Parameters:
key - The key with which the specified value is to be associated.
value - The value to be associated with the specified key.

remove

public Object remove(String key)

setEventDispatcher

public void setEventDispatcher(EventBus dispatcher)
Description copied from interface: Context
Sets the event dispatcher associated with the hsm to which the context belongs.

Specified by:
setEventDispatcher in interface Context

getEventDispatcher

public EventBus getEventDispatcher()
Description copied from interface: Context
Returns the event dispatcher associated with the hsm to which the context belongs.

Specified by:
getEventDispatcher in interface Context

setTriggerEvent

public void setTriggerEvent(Event trigger)
Description copied from interface: Context
Sets the trigger event. Some actions are performed because a trigger event has been received. This is used by the interpreter to update the action context.

Specified by:
setTriggerEvent in interface Context
Parameters:
trigger - The trigger event that was responsible for the execution of the action.

getTriggerEvent

public Event getTriggerEvent()
Description copied from interface: Context
Returns the trigger event. Some actions are performed because a trigger event has been received. If an action is interested in the type of the event or it's parameters it can grab a reference to the event by using this method.

Specified by:
getTriggerEvent in interface Context
Returns:
The trigger event that was responsible for the execution of the action.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.