public class RemoteExecutionControl extends DirectExecutionControl implements ExecutionControl
DirectExecutionControl
which adds stop support controlled by
an external process. Designed to work with JDIDefaultExecutionControl
.ExecutionControl.ClassBytecodes, ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException, ExecutionControl.ExecutionControlException, ExecutionControl.Generator, ExecutionControl.InternalException, ExecutionControl.NotImplementedException, ExecutionControl.ResolutionException, ExecutionControl.RunException, ExecutionControl.StoppedException, ExecutionControl.UserException
Constructor and Description |
---|
RemoteExecutionControl() |
Modifier and Type | Method and Description |
---|---|
protected void |
clientCodeEnter()
Marks entry into user code.
|
protected void |
clientCodeLeave()
Marks departure from user code.
|
protected String |
invoke(Method doitMethod)
Invoke the specified "doit-method", a static method with no parameters.
|
static void |
main(String[] args)
Launch the agent, connecting to the JShell-core over the socket specified
in the command-line argument.
|
void |
stop()
Interrupts a running invoke.
|
protected String |
throwConvertedInvocationException(Throwable cause)
Converts incoming exceptions in user code into instances of subtypes of
ExecutionControl.ExecutionControlException and throws the
converted exception. |
protected String |
throwConvertedOtherException(Throwable ex)
Converts incoming exceptions in agent code into instances of subtypes of
ExecutionControl.ExecutionControlException and throws the
converted exception. |
String |
varValue(String className,
String varName)
Returns the value of a variable.
|
addToClasspath, close, extensionCommand, findClass, invoke, load, redefine, setClasspath, valueString
addToClasspath, close, extensionCommand, invoke, load, redefine, setClasspath
public static void main(String[] args) throws Exception
args
- standard command-line arguments, expectation is the socket
number is the only argumentException
- any unexpected exceptionpublic void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
DirectExecutionControl
Not supported.
stop
in interface ExecutionControl
stop
in class DirectExecutionControl
ExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.InternalException
- an internal problem occurredprotected String invoke(Method doitMethod) throws Exception
DirectExecutionControl
DirectExecutionControl.invoke(java.lang.String, java.lang.String)
in this class will call this to invoke.invoke
in class DirectExecutionControl
doitMethod
- the Method to invokeException
- any exceptions thrown by
Method.invoke(Object, Object...)
or any ExecutionControl.ExecutionControlException
to pass-through.public String varValue(String className, String varName) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
varValue
in interface ExecutionControl
varValue
in class DirectExecutionControl
className
- the name of the wrapper class of the variablevarName
- the name of the variableExecutionControl.UserException
- formatting the value raised a user exceptionExecutionControl.ResolutionException
- formatting the value attempted to directly or
indirectly invoke an unresolved snippetExecutionControl.StoppedException
- if the formatting the value was canceled by
ExecutionControl.stop()
ExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.InternalException
- an internal problem occurredExecutionControl.RunException
protected String throwConvertedInvocationException(Throwable cause) throws ExecutionControl.RunException, ExecutionControl.InternalException
DirectExecutionControl
ExecutionControl.ExecutionControlException
and throws the
converted exception.throwConvertedInvocationException
in class DirectExecutionControl
cause
- the exception to convertExecutionControl.RunException
- for normal exception occurrencesExecutionControl.InternalException
- for internal problemsprotected String throwConvertedOtherException(Throwable ex) throws ExecutionControl.RunException, ExecutionControl.InternalException
DirectExecutionControl
ExecutionControl.ExecutionControlException
and throws the
converted exception.throwConvertedOtherException
in class DirectExecutionControl
ex
- the exception to convertExecutionControl.RunException
- for normal exception occurrencesExecutionControl.InternalException
- for internal problemsprotected void clientCodeEnter()
DirectExecutionControl
clientCodeEnter
in class DirectExecutionControl
protected void clientCodeLeave() throws ExecutionControl.InternalException
DirectExecutionControl
clientCodeLeave
in class DirectExecutionControl
ExecutionControl.InternalException
- in unexpected failure cases
Copyright © 2015, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-07-11-224625.robert.dev