public class RespectVM
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected java.util.List<InspectableEventListener> |
inspectors
listener to VM inspectable events
|
protected java.util.List<ObservableEventListener> |
observers |
Constructor and Description |
---|
RespectVM(TupleCentreId tid,
RespectTCContainer c,
int qSize,
IRespectTC respectTC) |
protected java.util.List<InspectableEventListener> inspectors
protected java.util.List<ObservableEventListener> observers
public RespectVM(TupleCentreId tid, RespectTCContainer c, int qSize, IRespectTC respectTC)
tid
- the identifier of the tuple centre this VM should managec
- the ReSpecT tuple centres manager this VM should interact withqSize
- the maximum InQ sizerespectTC
- the reference to the ReSpecT tuple centre this VM should
managepublic boolean abortOperation(long opId)
opId
- the progressive, unique per tuple centre identifier of an
operationpublic void addInspector(InspectableEventListener l)
l
- the listener of inspectable events to addpublic void addObserver(ObservableEventListener l)
l
- the listener of observable events to addpublic void disablePersistency(java.lang.String path, TucsonTupleCentreId fileName)
path
- the path where persistency information is storedfileName
- the name of the file where persistency information is storedpublic void doOperation(IId id, RespectOperation op) throws OperationNotPossibleException
id
- the identifier of who is issuing the operationop
- the operation requestedOperationNotPossibleException
- if the requested operation cannot be carried outpublic void enablePersistency(java.lang.String path, TucsonTupleCentreId fileName)
path
- the path where to store persistency informationfileName
- the name of the file to create for storing persistency
informationpublic RespectTCContainer getContainer()
public TupleCentreId getId()
public java.util.ArrayList<InspectableEventListener> getInspectors()
public java.util.List<ObservableEventListener> getObservers()
public AbstractBehaviourSpecification getReactionSpec()
public RespectVMContext getRespectVMContext()
public LogicTuple[] getTRSet()
public LogicTuple[] getTSet(LogicTuple filter)
filter
- the tuple template to be used in filtering tuplespublic WSetEvent[] getWSet(LogicTuple filter)
filter
- the tuple template to be used in filtering InQ eventspublic void goCommand() throws OperationNotPossibleException
OperationNotPossibleException
- if the requested operation cannot be carried outpublic boolean hasInspectors()
public boolean hasObservers()
public boolean isStepModeCommand()
public void nextStepCommand() throws OperationNotPossibleException
OperationNotPossibleException
- if the ReSpecT VM is not in step modepublic void notifyInspectableEvent(InspectableEvent e)
e
- the inpsectable event to notify to listenerspublic void notifyNewInputEvent()
public void notifyObservableEvent(AbstractEvent ev)
ev
- the observable event to notify to listenerspublic void recoveryPersistent(java.lang.String path, java.lang.String file, TucsonTupleCentreId tcName)
path
- the path where persistency information is storedfile
- the name of the file where persistency information is storedtcName
- the name of the tuple centre to be recoveredpublic void removeInspector(InspectableEventListener l)
l
- the inspectable events listener to removepublic void removeObserver(ObservableEventListener l)
l
- the observable events listener to removepublic void reset()
public void run()
run
in interface java.lang.Runnable
public void setManagementMode(boolean activate)
activate
- toggles management mode on and offpublic boolean setReactionSpec(AbstractBehaviourSpecification spec)
spec
- the ReSpecT specification to overwrite current one withpublic void setWSet(java.util.List<LogicTuple> wSet)
wSet
- the InQ to overwrite current one withpublic void stepModeCommand()
public void stopCommand() throws OperationNotPossibleException
OperationNotPossibleException
- if the requested operation cannot be carried out