|
The Meta-Environment API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoolbus.ToolBus
toolbus.viewer.DebugToolBus
public class DebugToolBus
A specialized version of the ToolBus, which executes the process logic in debug mode. Viewer implementations need to use this ToolBus instead of the regular one.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class toolbus.ToolBus |
---|
ToolBus.ProcessInstanceIterator |
Field Summary | |
---|---|
private boolean |
breakWhileStepping
|
private int |
currentState
|
private boolean |
doRun
|
private boolean |
doStep
|
private long |
nextTime
|
private PerformanceInformationHandler |
performanceInformationRetriever
|
private toolbus.util.collections.ConcurrentHashSet<java.lang.String> |
processBreakPoints
|
private toolbus.util.collections.ConcurrentHashSet<java.lang.Integer> |
processInstanceBreakPoints
|
private java.lang.Object |
processLock
|
private boolean |
running
|
private java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> |
sourceCodeBreakPoints
|
private toolbus.util.collections.ConcurrentHashSet<StateElement> |
stateElementBreakPoints
|
private IViewer |
viewer
|
private boolean |
workHasArrived
|
Fields inherited from class toolbus.ToolBus |
---|
connectionHandler, matchStore, nerrors, portNumber, processes, propertyManager, shuttingDown, tbfactory |
Constructor Summary | |
---|---|
DebugToolBus(java.lang.String[] args,
IViewer viewer,
IPerformanceMonitor performanceMonitor)
Constructor. |
Method Summary | |
---|---|
ProcessInstance |
addProcess(ProcessCall call)
Add a process (as ProcessCall); previous two will become obsolete. |
void |
addProcessBreakPoint(java.lang.String processName)
Adds a breakpoint for all the process instances whos type is identified by the given name. |
void |
addProcessInstanceBreakPoint(int processId)
Adds a breakpoint for the process instance with the given id. |
void |
addSourceCodeBreakPoint(java.lang.String filename,
int lineNumber)
Adds a breakpoint on the given sourcecode coordinates. |
void |
addStateElementBreakPoint(StateElement stateElement)
Adds a breakpoint on the given state element. |
void |
doRun()
Notifies the debug toolbus that it should execute normally. |
void |
doStep()
Notifies the debug toolbus that it should execute one step. |
void |
doStop()
Notifies the debug toolbus that it should suspend its execution. |
void |
doTerminate()
Requests the termination of the ToolBus. |
void |
execute()
The main process loop of the ToolBus. |
private void |
fireStateChange(int state)
Sends a notification to the attached Viewer that the ToolBus's state changed. |
aterm.ATerm |
getToolBusPerformanceStats()
Gathers performance statistics related to JVM the current ToolBus is running in. |
void |
prepare()
|
void |
removeProcessBreakPoint(java.lang.String processName)
Removes the breakpoints for the process instances whos type is identified by the given name (if present). |
void |
removeProcessInstanceBreakPoint(int processId)
Removes the breakpoint on the process instance with the given id (if present). |
void |
removeSourceCodeBreakPoint(java.lang.String filename,
int lineNumber)
Removes the breakpoint from the given source code coordinates (if present). |
void |
removeStateElementBreakPoint(StateElement stateElement)
Removes the breakpoint from the given state element (if present). |
void |
setBreakWhileStepping(boolean breakWhileStepping)
Tells the debug toolbus whether or not it should fire 'breakPointHit' events while stepping. |
void |
setNextTime(long next)
Notifies the ToolBus that an atom with a delay on it, which could not be executed, has just been touched. |
void |
shutdown(aterm.ATerm msg)
Terminates the ToolBus. |
void |
startMonitoringTool(aterm.ATerm toolKey)
Initiates the monitoring of the tool associated with the given tool key (in case performance monitoring is enabled for this debug ToolBus). |
void |
startMonitorToolType(java.lang.String toolName)
Initiates the monitoring of the given tool type (in case performance monitoring is enabled for this debug ToolBus). |
void |
stopMonitoringTool(aterm.ATerm toolKey)
Stops monitoring the tool associated with the given tool key. |
void |
stopMonitoringToolType(java.lang.String toolName)
Stops monitoring tools of the given type. |
void |
workArrived(ToolInstance toolInstance,
byte operation)
Notifies the ToolBus that work has arrived. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private volatile int currentState
private volatile boolean running
private final java.lang.Object processLock
private volatile boolean workHasArrived
private volatile boolean doRun
private volatile boolean doStep
private volatile boolean breakWhileStepping
private final IViewer viewer
private final toolbus.util.collections.ConcurrentHashSet<java.lang.Integer> processInstanceBreakPoints
private final toolbus.util.collections.ConcurrentHashSet<java.lang.String> processBreakPoints
private final toolbus.util.collections.ConcurrentHashSet<StateElement> stateElementBreakPoints
private final java.util.Map<java.lang.String,java.util.List<java.lang.Integer>> sourceCodeBreakPoints
private final PerformanceInformationHandler performanceInformationRetriever
private long nextTime
Constructor Detail |
---|
public DebugToolBus(java.lang.String[] args, IViewer viewer, IPerformanceMonitor performanceMonitor)
args
- The arguments the ToolBus need to start (like include path and main script name).viewer
- The viewer that is attached to this ToolBus.performanceMonitor
- The tool performance monitor to use (optional argument; pass null in case
monitoring is not required).Method Detail |
---|
public ProcessInstance addProcess(ProcessCall call) throws ToolBusException
ToolBus
addProcess
in class ToolBus
ToolBusException
ToolBus.addProcess(ProcessCall)
public void shutdown(aterm.ATerm msg)
shutdown
in class ToolBus
ToolBus.shutdown(ATerm)
public void setNextTime(long next)
ToolBus
setNextTime
in class ToolBus
next
- The relative time in milliseconds that needs to elapse before the atom can be executed.ToolBus.setNextTime(long)
public void prepare()
prepare
in class ToolBus
public void execute()
execute
in class ToolBus
ToolBus.execute()
public void workArrived(ToolInstance toolInstance, byte operation)
ToolBus
workArrived
in class ToolBus
toolInstance
- The tool instance associated with the tool that send us data.operation
- The operation associated with the package that arrived.toolbus.ToolBus#workArrived()
public aterm.ATerm getToolBusPerformanceStats()
public void doRun()
public void doStop()
public void doStep()
public void doTerminate()
private void fireStateChange(int state)
state
- The state we changed to.public void setBreakWhileStepping(boolean breakWhileStepping)
breakWhileStepping
- The flag that indicates whether or not to break on breakpoints while stepping.public void addProcessInstanceBreakPoint(int processId)
processId
- The id of the process instance we want to add a breakpoint for.public void removeProcessInstanceBreakPoint(int processId)
processId
- The id of the process instance we want to remove the breakpoint for.public void addProcessBreakPoint(java.lang.String processName)
processName
- The name that identifies the type of process instances we want to add breakpoints
for.public void removeProcessBreakPoint(java.lang.String processName)
processName
- The name that identifies the type of process instance we want to remove the
breakpoints for.public void addStateElementBreakPoint(StateElement stateElement)
stateElement
- The state element we want to add a breakpoint for.public void removeStateElementBreakPoint(StateElement stateElement)
stateElement
- The state element we want to remove the breakpoint from.public void addSourceCodeBreakPoint(java.lang.String filename, int lineNumber)
filename
- The name of the sourcefilelineNumber
- The line number to add the breakpoint on. Note that sourcecode line numbers start
counting at 0.public void removeSourceCodeBreakPoint(java.lang.String filename, int lineNumber)
filename
- The name of the sourcefilelineNumber
- The line number to remove the breakpoint for.public void startMonitoringTool(aterm.ATerm toolKey)
toolKey
- The tool key associated with the tool we want to monitor.public void stopMonitoringTool(aterm.ATerm toolKey)
toolKey
- The tool key associated with the tool which we want to stop monitoring.public void startMonitorToolType(java.lang.String toolName)
toolName
- The tool type of tool we want to monitor.public void stopMonitoringToolType(java.lang.String toolName)
toolName
- The type of tool which we want to stop monitoring.
|
The Meta-Environment API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |