alice.tuplemedium
Interface Reactor

All Known Implementing Classes:
Reactor

public interface Reactor

Defines the tuple centre reactive behaviour, which is the core of its coordination ability. It manages reactions which are triggered by internal and external communication events and executed. See literature about tuple centre model for details.

See Also:
Reaction, TupleCentreVM

Method Summary
 boolean evalReaction(TriggeredReaction z)
          Evaluates (executes) a reaction.
 Tuple getReactionSpec()
          Gets the current reactive behaviour of the tuple centre
 java.util.ArrayList getTriggeredReactions(Event ev)
          Gets the reactions triggered by a communication event It represents the reaction specification function sigma.Z(event) of tuple centre formal model
 void onNewVMStableState()
          invoked by the tuple centre virtual machine when stable state is reached
 void reset()
          Resets the reactive component of the machine
 boolean setReactionSpec(Tuple spec)
          Sets the specification describing the reactive behaviour It's like the program specyfing the behaviour of the tuple centre reacting to communication events.
 boolean triggerReaction(Event ev)
          Checks if any reaction is triggered by a communication event
 

Method Detail

getTriggeredReactions

public java.util.ArrayList getTriggeredReactions(Event ev)
Gets the reactions triggered by a communication event It represents the reaction specification function sigma.Z(event) of tuple centre formal model
Parameters:
ev - the event triggering reactions
Returns:
the triggered reactions

triggerReaction

public boolean triggerReaction(Event ev)
Checks if any reaction is triggered by a communication event
Parameters:
ev - the event triggering reactions
Returns:
the triggered reactions

evalReaction

public boolean evalReaction(TriggeredReaction z)
Evaluates (executes) a reaction. It represents the reaction evaluating function (T',Z') = sigma.Eval(z,T) of the tuple centre model.
Parameters:
z - the triggered reaction to be evaluated
Returns:
true if the evaluation has been successful, false if not

setReactionSpec

public boolean setReactionSpec(Tuple spec)
Sets the specification describing the reactive behaviour It's like the program specyfing the behaviour of the tuple centre reacting to communication events.
Parameters:
spec - the behaviour specification described as a tuple
Returns:
true if the operation has been successful, false if not

getReactionSpec

public Tuple getReactionSpec()
Gets the current reactive behaviour of the tuple centre
Returns:
the specification of the behaviour as a tuple

reset

public void reset()
Resets the reactive component of the machine

onNewVMStableState

public void onNewVMStableState()
invoked by the tuple centre virtual machine when stable state is reached