|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--lime.Reaction
The superclass of all reactions. A reaction is specified by:
ONCE: When a tuple satisfying the reaction template
appears in the tuple space, the reaction is fired once and then the
reaction is removed automatically from the reactive program.ONCEPERTUPLE: When a tuple satisfying the reaction
template appears in the tuple space, the reaction is fired, and will never
fire again for that tuple. However, the reaction remains installed.
So, if multiple tuples enable the reaction, the reaction is fired once for
each of them. Reaction object to either the addStrongReaction
or the addWeakReaction methods. However, since the class
Reaction is abstract, only instances of its subclasses can
exist. In particular, addStrongReaction accepts only
instances of LocalizedReaction while
addWeakReaction can also accept instances of
UbiquitousReaction. In both cases, when the reaction is
fired, the reactsTo method of the
ReactionListener object associated with the reaction is
automatically invoked by the system.
The aforementioned methods addStrongReaction and
addWeakReaction return a RegisteredReaction
object to the user, that can be used to later deregister the reaction from
the shared tuple space. A RegisteredReaction object is
identical to the original Reaction object used for
registration, but provides additional information, part of which is
available to the user for bookkeeping purposes (e.g., the name of the
tuple space the reaction has been registered with) and part of which is
managed by the system.
LocalizedReaction,
UbiquitousReaction,
LimeSystemReaction,
ReactionListener,
RegisteredReaction,
LimeTupleSpace, Serialized Form| Field Summary | |
static short |
ONCE
The reaction is fired once and then it is removed automatically from the reactive program. |
static short |
ONCEPERTUPLE
The reaction is fired, and will never fire again for a given tuple, but remains registered. |
| Method Summary | |
Location |
getCurrentLocation()
Get the current location associated with the reaction. |
AgentLocation |
getDestinationLocation()
Get the destination location associated with the reaction. |
ReactionListener |
getListener()
Get the reaction listener associated with the reaction. |
short |
getMode()
Get the reaction mode. |
lights.interfaces.ITuple |
getTemplate()
Get the template associated with the reaction. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final short ONCE
public static final short ONCEPERTUPLE
| Method Detail |
public final lights.interfaces.ITuple getTemplate()
public final ReactionListener getListener()
public final short getMode()
public final Location getCurrentLocation()
public final AgentLocation getDestinationLocation()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||