|
SandMark version 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sandmark.util.exec.Overseer
The sandmark.util.exec.Overseer class contains methods for running another program using the Java Debugger Interface (JDI).
To use this class you would typically extend it, and override one or more of the methods onMethodEntry, onMethodExit, and onProgramExit:
public class MyOverseer extends sandmark.util.exec.Overseer { public MyOverseer( java.util.Properties props) { super(includeClasses,excludeClasses, constructArgv(props)); } public void onMethodEntry ( sandmark.util.exec.MethodCallData data) { } public void onMethodExit ( sandmark.util.exec.MethodCallData data) { } public void onProgramExit ( com.sun.jdi.VirtualMachine vm) { } }
The methods 'run' and 'waitToComplete' are used to start the program and wait for it to exit:
MyOverseer O = new MyOverseer(includeClasses,excludeClasses,argv); O.run(); ... O.waitToComplete();
Field Summary | |
(package private) java.lang.String[] |
argv
|
protected java.util.List |
breakPoints
|
(package private) EventThread |
eventThread
|
protected java.lang.String[] |
excludeClasses
|
protected java.lang.String[] |
includeClasses
|
(package private) Output |
out
|
protected com.sun.jdi.VirtualMachine |
vm
|
Constructor Summary | |
Overseer(java.lang.String[] argv)
|
|
Overseer(java.lang.String[] includeClasses,
java.lang.String[] excludeClasses,
java.lang.String[] argv)
Prepare to run a program under JDI debugging. |
Method Summary | |
static java.lang.String[] |
constructArgv(java.util.Properties props)
Given information in the props argument, construct an argv suitable to submit to an Overseer. |
protected void |
onMethodEntry(MethodCallData data)
Override this method if you want some action to take place when a method is called. |
protected void |
onMethodExit(MethodCallData data)
Override this method if you want some action to take place when a method is exiting. |
protected void |
onProgramExit(com.sun.jdi.VirtualMachine vm)
Override this method if you want some action to take place when the program is exiting. |
void |
registerBreakpoint(Breakpoint bp)
|
void |
run()
Start running the program. |
void |
STOP()
Stop the running program. |
void |
waitToComplete()
Wait for the program to finish executing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.sun.jdi.VirtualMachine vm
protected java.lang.String[] excludeClasses
protected java.lang.String[] includeClasses
protected java.util.List breakPoints
java.lang.String[] argv
Output out
EventThread eventThread
Constructor Detail |
public Overseer(java.lang.String[] includeClasses, java.lang.String[] excludeClasses, java.lang.String[] argv)
includeClasses
- Classes which should be traced.excludeClasses
- Classes which should not be traced.argv
- Command-line arguments to the program
to be executed.
Note: Only one of includeClasses and excludeClasses can be non-empty!
public Overseer(java.lang.String[] argv)
Method Detail |
public void registerBreakpoint(Breakpoint bp)
protected void onMethodEntry(MethodCallData data)
data
- Information about which method was called,
where it's declared, who called it, etc.protected void onMethodExit(MethodCallData data)
data
- Information about which method is exiting,
where it was declared from, who called it, etc.protected void onProgramExit(com.sun.jdi.VirtualMachine vm)
vm
- A handle to the virtual machine running the program.public void waitToComplete()
public void run() throws TracingException
TracingException
public void STOP()
public static java.lang.String[] constructArgv(java.util.Properties props)
props
- should contain the following properties:
|
SandMark version 2.0 Mon Jun 17 12:30:47 MST 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |