java.lang.Object
jdk.jshell.execution.StreamingExecutionControl
- All Implemented Interfaces:
- AutoCloseable,- ExecutionControl
- Direct Known Subclasses:
- JdiExecutionControl
An implementation of the 
ExecutionControl
 execution engine SPI which streams requests to a remote agent where
 execution takes place.- Since:
- 9
- 
Nested Class SummaryNested classes/interfaces declared in interface jdk.jshell.spi.ExecutionControlExecutionControl.ClassBytecodes, ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException, ExecutionControl.ExecutionControlException, ExecutionControl.InternalException, ExecutionControl.NotImplementedException, ExecutionControl.ResolutionException, ExecutionControl.RunException, ExecutionControl.StoppedException, ExecutionControl.UserException
- 
Constructor SummaryConstructorsConstructorDescriptionCreates an instance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddToClasspath(String path) Adds the path to the execution class path.voidclose()Closes the execution engine.extensionCommand(String command, Object arg) Run a non-standard command (or a standard command from a newer version).Invokes an executable Snippet by calling a method on the specified wrapper class.voidload(ExecutionControl.ClassBytecodes[] cbcs) Attempts to load new classes.voidAttempts to redefine previously loaded classes.voidstop()Interrupts a running invoke.Returns the value of a variable.
- 
Constructor Details- 
StreamingExecutionControlCreates an instance.- Parameters:
- out- the output for commands
- in- the input for command responses
 
 
- 
- 
Method Details- 
loadpublic void load(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException Description copied from interface:ExecutionControlAttempts to load new classes.- Specified by:
- loadin interface- ExecutionControl
- Parameters:
- cbcs- the class name and bytecodes to load
- Throws:
- ExecutionControl.ClassInstallException- exception occurred loading the classes, some or all were not loaded
- ExecutionControl.NotImplementedException- if not implemented
- ExecutionControl.EngineTerminationException- the execution engine has terminated
 
- 
redefinepublic void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException Description copied from interface:ExecutionControlAttempts to redefine previously loaded classes.- Specified by:
- redefinein interface- ExecutionControl
- Parameters:
- cbcs- the class name and bytecodes to redefine
- Throws:
- ExecutionControl.ClassInstallException- exception occurred redefining the classes, some or all were not redefined
- ExecutionControl.NotImplementedException- if not implemented
- ExecutionControl.EngineTerminationException- the execution engine has terminated
 
- 
invokepublic String invoke(String classname, String methodname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException Description copied from interface:ExecutionControlInvokes an executable Snippet by calling a method on the specified wrapper class. The method must have no arguments and return String.- Specified by:
- invokein interface- ExecutionControl
- Parameters:
- classname- the class whose method should be invoked
- methodname- the name of method to invoke
- Returns:
- the result of the execution or null if no result
- Throws:
- ExecutionControl.UserException- the invoke raised a user exception
- ExecutionControl.ResolutionException- the invoke attempted to directly or indirectly invoke an unresolved snippet
- ExecutionControl.StoppedException- if the- invoke()was canceled by- ExecutionControl.stop()
- ExecutionControl.EngineTerminationException- the execution engine has terminated
- ExecutionControl.InternalException- an internal problem occurred
- ExecutionControl.RunException
 
- 
varValuepublic String varValue(String classname, String varname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException Description copied from interface:ExecutionControlReturns the value of a variable.- Specified by:
- varValuein interface- ExecutionControl
- Parameters:
- classname- the name of the wrapper class of the variable
- varname- the name of the variable
- Returns:
- the value of the variable
- Throws:
- ExecutionControl.UserException- formatting the value raised a user exception
- ExecutionControl.ResolutionException- formatting the value attempted to directly or indirectly invoke an unresolved snippet
- ExecutionControl.StoppedException- if the formatting the value was canceled by- ExecutionControl.stop()
- ExecutionControl.EngineTerminationException- the execution engine has terminated
- ExecutionControl.InternalException- an internal problem occurred
- ExecutionControl.RunException
 
- 
addToClasspathpublic void addToClasspath(String path) throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException Description copied from interface:ExecutionControlAdds the path to the execution class path.- Specified by:
- addToClasspathin interface- ExecutionControl
- Parameters:
- path- the path to add
- Throws:
- ExecutionControl.EngineTerminationException- the execution engine has terminated
- ExecutionControl.InternalException- an internal problem occurred
 
- 
stoppublic void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalExceptionDescription copied from interface:ExecutionControlInterrupts a running invoke.- Specified by:
- stopin interface- ExecutionControl
- Throws:
- ExecutionControl.EngineTerminationException- the execution engine has terminated
- ExecutionControl.InternalException- an internal problem occurred
 
- 
extensionCommandpublic Object extensionCommand(String command, Object arg) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException Description copied from interface:ExecutionControlRun a non-standard command (or a standard command from a newer version).- Specified by:
- extensionCommandin interface- ExecutionControl
- Parameters:
- command- the non-standard command
- arg- the commands argument
- Returns:
- the commands return value
- Throws:
- ExecutionControl.UserException- the command raised a user exception
- ExecutionControl.ResolutionException- the command attempted to directly or indirectly invoke an unresolved snippet
- ExecutionControl.StoppedException- if the command was canceled by- ExecutionControl.stop()
- ExecutionControl.EngineTerminationException- the execution engine has terminated
- ExecutionControl.NotImplementedException- if not implemented
- ExecutionControl.InternalException- an internal problem occurred
- ExecutionControl.RunException
 
- 
closepublic void close()Closes the execution engine. Send an exit command to the remote agent.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- ExecutionControl
 
 
-