AutoCloseable
, ExecutionControl
JdiExecutionControl
public class StreamingExecutionControl extends Object implements ExecutionControl
ExecutionControl
execution engine SPI which streams requests to a remote agent where execution takes place.ExecutionControl.ClassBytecodes, ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException, ExecutionControl.ExecutionControlException, ExecutionControl.InternalException, ExecutionControl.NotImplementedException, ExecutionControl.ResolutionException, ExecutionControl.RunException, ExecutionControl.StoppedException, ExecutionControl.UserException
Constructor | Description |
---|---|
StreamingExecutionControl |
Creates an instance. |
Modifier and Type | Method | Description |
---|---|---|
void |
addToClasspath |
Adds the path to the execution class path. |
void |
close() |
Closes the execution engine. |
Object |
extensionCommand |
Run a non-standard command (or a standard command from a newer version). |
String |
invoke |
Invokes an executable Snippet by calling a method on the specified wrapper class. |
void |
load |
Attempts to load new classes. |
void |
redefine |
Attempts to redefine previously loaded classes. |
void |
stop() |
Interrupts a running invoke. |
String |
varValue |
Returns the value of a variable. |
public StreamingExecutionControl(ObjectOutput out, ObjectInput in)
out
- the output for commandsin
- the input for command responsespublic void load(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException
ExecutionControl
load
in interface ExecutionControl
cbcs
- the class name and bytecodes to loadExecutionControl.ClassInstallException
- exception occurred loading the classes, some or all were not loadedExecutionControl.NotImplementedException
- if not implementedExecutionControl.EngineTerminationException
- the execution engine has terminatedpublic void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException
ExecutionControl
redefine
in interface ExecutionControl
cbcs
- the class name and bytecodes to redefineExecutionControl.ClassInstallException
- exception occurred redefining the classes, some or all were not redefinedExecutionControl.NotImplementedException
- if not implementedExecutionControl.EngineTerminationException
- the execution engine has terminatedpublic String invoke(String classname, String methodname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
invoke
in interface ExecutionControl
classname
- the class whose method should be invokedmethodname
- the name of method to invokeExecutionControl.UserException
- the invoke raised a user exceptionExecutionControl.ResolutionException
- the invoke attempted to directly or indirectly invoke an unresolved snippetExecutionControl.StoppedException
- if the invoke()
was canceled by ExecutionControl.stop()
ExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.InternalException
- an internal problem occurredExecutionControl.RunException
public String varValue(String classname, String varname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
varValue
in interface ExecutionControl
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
public void addToClasspath(String path) throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
addToClasspath
in interface ExecutionControl
path
- the path to addExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.InternalException
- an internal problem occurredpublic void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
stop
in interface ExecutionControl
ExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.InternalException
- an internal problem occurredpublic Object extensionCommand(String command, Object arg) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
ExecutionControl
extensionCommand
in interface ExecutionControl
command
- the non-standard commandarg
- the commands argumentExecutionControl.UserException
- the command raised a user exceptionExecutionControl.ResolutionException
- the command attempted to directly or indirectly invoke an unresolved snippetExecutionControl.StoppedException
- if the command was canceled by ExecutionControl.stop()
ExecutionControl.EngineTerminationException
- the execution engine has terminatedExecutionControl.NotImplementedException
- if not implementedExecutionControl.InternalException
- an internal problem occurredExecutionControl.RunException
public void close()
close
in interface AutoCloseable
close
in interface ExecutionControl
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.jshell/jdk/jshell/execution/StreamingExecutionControl.html