public class Runner extends Object implements MessageConsumer
| Modifier and Type | Field and Description |
|---|---|
protected JavaBuild |
build |
protected boolean |
cancelled |
protected Object |
cancelLock |
protected JavaEditor |
editor |
protected Thread |
errThread |
protected SketchException |
exception |
protected RunnerListener |
listener |
protected Thread |
outThread |
protected Process |
process |
protected PrintStream |
sketchErr |
protected PrintStream |
sketchOut |
protected com.sun.jdi.VirtualMachine |
vm |
protected boolean |
vmReturnedError |
| Constructor and Description |
|---|
Runner(JavaBuild build,
RunnerListener listener) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.sun.jdi.VirtualMachine |
debug(String[] args)
Simple non-blocking launch of the virtual machine.
|
void |
exceptionEvent(com.sun.jdi.event.ExceptionEvent event) |
protected com.sun.jdi.connect.Connector |
findConnector(String connectorName) |
protected SketchException |
findException(String message,
com.sun.jdi.ObjectReference or,
com.sun.jdi.ThreadReference thread)
Move through a list of stack frames, searching for references to code
found in the current sketch.
|
protected void |
generateTrace()
Generate the trace.
|
protected StringList |
getMachineParams() |
protected StringList |
getSketchParams(boolean present,
String[] args) |
static boolean |
handleCommonErrors(String exceptionClass,
String message,
RunnerListener listener,
PrintStream err)
Provide more useful explanations of common error messages, perhaps with
a short message in the status area, and (if necessary) a longer message
in the console.
|
com.sun.jdi.VirtualMachine |
launch(String[] args) |
protected void |
launchJava(String[] args) |
boolean |
launchVirtualMachine(boolean present,
String[] args) |
void |
message(String s) |
com.sun.jdi.VirtualMachine |
present(String[] args) |
protected void |
redirectStreams(com.sun.jdi.VirtualMachine vm)
Redirect a VMs output and error streams to System.out and System.err
|
protected void |
reportException(String message,
com.sun.jdi.ObjectReference or,
com.sun.jdi.ThreadReference thread) |
com.sun.jdi.VirtualMachine |
vm()
Additional access to the virtual machine.
|
boolean |
vmReturnedError()
Whether the last invocation of launchJava() was successful or not
|
protected RunnerListener listener
protected volatile com.sun.jdi.VirtualMachine vm
protected boolean vmReturnedError
protected Thread errThread
protected Thread outThread
protected SketchException exception
protected JavaEditor editor
protected JavaBuild build
protected Process process
protected PrintStream sketchErr
protected PrintStream sketchOut
protected volatile boolean cancelled
protected final Object cancelLock
public Runner(JavaBuild build, RunnerListener listener) throws SketchException
SketchExceptionpublic com.sun.jdi.VirtualMachine launch(String[] args)
public com.sun.jdi.VirtualMachine present(String[] args)
public boolean vmReturnedError()
public com.sun.jdi.VirtualMachine debug(String[] args)
protected void redirectStreams(com.sun.jdi.VirtualMachine vm)
public com.sun.jdi.VirtualMachine vm()
public boolean launchVirtualMachine(boolean present,
String[] args)
protected StringList getMachineParams()
protected StringList getSketchParams(boolean present, String[] args)
protected void launchJava(String[] args)
protected void generateTrace()
protected com.sun.jdi.connect.Connector findConnector(String connectorName)
public void exceptionEvent(com.sun.jdi.event.ExceptionEvent event)
public static boolean handleCommonErrors(String exceptionClass, String message, RunnerListener listener, PrintStream err)
exceptionClass - Class name causing the error (with full package name)message - The message from the exceptionlistener - The Editor or command line interface that's listening for errorsprotected void reportException(String message, com.sun.jdi.ObjectReference or, com.sun.jdi.ThreadReference thread)
protected SketchException findException(String message, com.sun.jdi.ObjectReference or, com.sun.jdi.ThreadReference thread)
public void close()
public void message(String s)
message in interface MessageConsumerCopyright © 2001–2017 Processing Foundation. All rights reserved.