|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectlime.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 | |
private LimeTemplate |
limeTmpl
|
private ReactionListener |
listener
|
private short |
mode
|
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. |
(package private) PendingUponListener |
pendUponListener
|
private lights.interfaces.ITuple |
template
|
| Constructor Summary | |
(package private) |
Reaction()
|
(package private) |
Reaction(lights.interfaces.ITuple template,
ReactionListener listener,
short mode)
|
(package private) |
Reaction(LimeTemplate lt,
ReactionListener listener,
short mode)
|
| Method Summary | |
Location |
getCurrentLocation()
Get the current location associated with the reaction. |
AgentLocation |
getDestinationLocation()
Get the destination location associated with the reaction. |
(package private) lights.interfaces.ITuple |
getLimifiedTemplate()
Get the template associated with the reaction...without delimifying it. |
ReactionListener |
getListener()
Get the reaction listener associated with the reaction. |
short |
getMode()
Get the reaction mode. |
LimeTemplate |
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
private LimeTemplate limeTmpl
private lights.interfaces.ITuple template
private ReactionListener listener
PendingUponListener pendUponListener
private short mode
| Constructor Detail |
Reaction()
Reaction(LimeTemplate lt, ReactionListener listener, short mode)
Reaction(lights.interfaces.ITuple template,
ReactionListener listener,
short mode)
throws lights.interfaces.TupleSpaceException
| Method Detail |
public final LimeTemplate getTemplate()
final lights.interfaces.ITuple getLimifiedTemplate()
public final ReactionListener getListener()
public final short getMode()
public final Location getCurrentLocation()
public final AgentLocation getDestinationLocation()
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||