public class ManagementContext extends java.lang.Object implements IManagementContext
Constructor and Description |
---|
ManagementContext(RespectVM rvm) |
Modifier and Type | Method and Description |
---|---|
boolean |
abortOperation(long opId)
Abort a previously executed in or rd operation
The method is successful only if the operation has not completed
|
void |
addInspector(InspectableEventListener l) |
void |
addObserver(ObservableEventListener l) |
void |
disablePersistency(java.lang.String path,
TucsonTupleCentreId fileName) |
void |
enablePersistency(java.lang.String path,
TucsonTupleCentreId fileName) |
java.util.ArrayList<InspectableEventListener> |
getInspectors() |
RespectSpecification |
getSpec()
Get current behaviour specification
|
LogicTuple[] |
getTRSet(LogicTuple t)
Gets current content of the triggered reactions in terms of logic tuples
|
LogicTuple[] |
getTSet(LogicTuple t)
Gets current content of the tuple set
|
WSetEvent[] |
getWSet(LogicTuple t)
Gets current content of the query set in terms of logic tuples
|
void |
goCommand()
Resumes VM execution (management mode)
|
boolean |
hasInspectors() |
boolean |
hasObservers() |
boolean |
isStepModeCommand()
enable/disable VM step mode
|
void |
nextStepCommand()
Executes a single execution step (step mode)
|
void |
recoveryPersistent(java.lang.String path,
java.lang.String file,
TucsonTupleCentreId tcName) |
void |
removeInspector(InspectableEventListener l) |
void |
removeObserver(ObservableEventListener l) |
void |
reset() |
void |
setManagementMode(boolean activate) |
void |
setSpec(RespectSpecification spec)
Specify the behaviour of the tuple centre
|
void |
setWSet(java.util.List<LogicTuple> wSet)
Sets current content of the query set in terms of logic tuples
|
void |
stepModeCommand()
enable/disable VM step mode
|
void |
stopCommand()
Stops the VM (management mode, debugging)
|
public ManagementContext(RespectVM rvm)
rvm
- the ReSpecT VM this context refers topublic boolean abortOperation(long opId)
IManagementContext
abortOperation
in interface IManagementContext
opId
- the operation identifierpublic void addInspector(InspectableEventListener l)
addInspector
in interface IManagementContext
l
- the listener of inspectable eventspublic void addObserver(ObservableEventListener l)
addObserver
in interface IManagementContext
l
- the listener of observable eventspublic void disablePersistency(java.lang.String path, TucsonTupleCentreId fileName)
disablePersistency
in interface IManagementContext
public void enablePersistency(java.lang.String path, TucsonTupleCentreId fileName)
enablePersistency
in interface IManagementContext
public java.util.ArrayList<InspectableEventListener> getInspectors()
getInspectors
in interface IManagementContext
public RespectSpecification getSpec()
IManagementContext
getSpec
in interface IManagementContext
public LogicTuple[] getTRSet(LogicTuple t)
IManagementContext
getTRSet
in interface IManagementContext
t
- tuple filtering tuples to be retrievedpublic LogicTuple[] getTSet(LogicTuple t)
IManagementContext
getTSet
in interface IManagementContext
t
- tuple filtering tuples to be retrievedpublic WSetEvent[] getWSet(LogicTuple t)
IManagementContext
getWSet
in interface IManagementContext
t
- tuple filtering tuples to be retrievedpublic void goCommand() throws OperationNotPossibleException
IManagementContext
goCommand
in interface IManagementContext
OperationNotPossibleException
- if the operation is not possible according to current VM
statepublic boolean hasInspectors()
hasInspectors
in interface IManagementContext
true
if the tuple centre has some inspector
listeningpublic boolean hasObservers()
hasObservers
in interface IManagementContext
true
if the tuple centre has some observers
listeningpublic boolean isStepModeCommand()
IManagementContext
isStepModeCommand
in interface IManagementContext
public void nextStepCommand() throws OperationNotPossibleException
IManagementContext
nextStepCommand
in interface IManagementContext
OperationNotPossibleException
- if the operation cannot be performedpublic void recoveryPersistent(java.lang.String path, java.lang.String file, TucsonTupleCentreId tcName)
recoveryPersistent
in interface IManagementContext
public void removeInspector(InspectableEventListener l)
removeInspector
in interface IManagementContext
l
- the listener of inspectable eventspublic void removeObserver(ObservableEventListener l)
removeObserver
in interface IManagementContext
l
- the listener of observable eventspublic void reset()
reset
in interface IManagementContext
public void setManagementMode(boolean activate)
setManagementMode
in interface IManagementContext
public void setSpec(RespectSpecification spec) throws InvalidSpecificationException
IManagementContext
setSpec
in interface IManagementContext
spec
- The specification in ReSpecT languageInvalidSpecificationException
- If the specification is not correctpublic void setWSet(java.util.List<LogicTuple> wSet)
IManagementContext
setWSet
in interface IManagementContext
wSet
- set in terms of logic tuplespublic void stepModeCommand()
IManagementContext
stepModeCommand
in interface IManagementContext
public void stopCommand() throws OperationNotPossibleException
IManagementContext
stopCommand
in interface IManagementContext
OperationNotPossibleException
- if the operation is not possible according to current VM
state