alice.respect
Class Reactor

java.lang.Object
  |
  +--alice.respect.Reactor
All Implemented Interfaces:
Reactor

public class Reactor
extends java.lang.Object
implements Reactor

this class defines the ReSpecT tuple centre reactor component.

the specified reactions are parsed and executed using tuProlog engines.


Constructor Summary
Reactor(TupleCentreVM m)
           
 
Method Summary
static LogicTuple checkReactionSpec(LogicTuple spec)
           
 boolean evalReaction(TriggeredReaction z)
          reaction exectution is realized solving the goal represented by reaction body
 java.lang.String getOutTCactivityClassFile()
           
 Tuple getReactionSpec()
          Gets the current reactive behaviour of the tuple centre
 alice.tuprolog.Term getTerm(Event ev)
           
 java.util.ArrayList getTriggeredReactions(Event ev)
          the triggered reactions are collected the tuProlog engine, finding all the solutions of the requested goal
 void onNewVMStableState()
          invoked by the tuple centre virtual machine when stable state is reached
 void reset()
          Resets the reactive component of the machine
 void setOutTCactivityClassFile(java.lang.String classFile)
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Reactor

public Reactor(TupleCentreVM m)
Method Detail

reset

public void reset()
Description copied from interface: Reactor
Resets the reactive component of the machine
Specified by:
reset in interface Reactor

getTriggeredReactions

public java.util.ArrayList getTriggeredReactions(Event ev)
the triggered reactions are collected the tuProlog engine, finding all the solutions of the requested goal
Specified by:
getTriggeredReactions in interface Reactor
Following copied from interface: alice.tuplemedium.Reactor
Parameters:
ev - the event triggering reactions
Returns:
the triggered reactions

triggerReaction

public boolean triggerReaction(Event ev)
Description copied from interface: Reactor
Checks if any reaction is triggered by a communication event
Specified by:
triggerReaction in interface Reactor
Following copied from interface: alice.tuplemedium.Reactor
Parameters:
ev - the event triggering reactions
Returns:
the triggered reactions

evalReaction

public boolean evalReaction(TriggeredReaction z)
reaction exectution is realized solving the goal represented by reaction body
Specified by:
evalReaction in interface Reactor
Following copied from interface: alice.tuplemedium.Reactor
Parameters:
z - the triggered reaction to be evaluated
Returns:
true if the evaluation has been successful, false if not

getTerm

public alice.tuprolog.Term getTerm(Event ev)

setReactionSpec

public boolean setReactionSpec(Tuple spec)
Description copied from interface: Reactor
Sets the specification describing the reactive behaviour It's like the program specyfing the behaviour of the tuple centre reacting to communication events.
Specified by:
setReactionSpec in interface Reactor
Following copied from interface: alice.tuplemedium.Reactor
Parameters:
spec - the behaviour specification described as a tuple
Returns:
true if the operation has been successful, false if not

getReactionSpec

public Tuple getReactionSpec()
Description copied from interface: Reactor
Gets the current reactive behaviour of the tuple centre
Specified by:
getReactionSpec in interface Reactor
Following copied from interface: alice.tuplemedium.Reactor
Returns:
the specification of the behaviour as a tuple

checkReactionSpec

public static LogicTuple checkReactionSpec(LogicTuple spec)

setOutTCactivityClassFile

public void setOutTCactivityClassFile(java.lang.String classFile)

getOutTCactivityClassFile

public java.lang.String getOutTCactivityClassFile()

onNewVMStableState

public void onNewVMStableState()
Description copied from interface: Reactor
invoked by the tuple centre virtual machine when stable state is reached
Specified by:
onNewVMStableState in interface Reactor