java.lang.Object
jdk.jshell.execution.DirectExecutionControl
jdk.jshell.execution.LocalExecutionControl
- All Implemented Interfaces:
AutoCloseable,ExecutionControl
An implementation of
ExecutionControl which executes
in the same JVM as the JShell-core.- Since:
- 9
-
Nested Class Summary
Nested classes/interfaces inherited from interface jdk.jshell.spi.ExecutionControl
ExecutionControl.ClassBytecodes, ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException, ExecutionControl.ExecutionControlException, ExecutionControl.InternalException, ExecutionControl.NotImplementedException, ExecutionControl.ResolutionException, ExecutionControl.RunException, ExecutionControl.StoppedException, ExecutionControl.UserException -
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance using the default class loading.LocalExecutionControl(LoaderDelegate loaderDelegate) Creates an instance, delegating loader operations to the specified delegate. -
Method Summary
Methods inherited from class jdk.jshell.execution.DirectExecutionControl
addToClasspath, classesRedefined, close, extensionCommand, findClass, invoke, load, redefine, throwConvertedInvocationException, throwConvertedOtherException, valueString, varValue
-
Constructor Details
-
LocalExecutionControl
Creates an instance, delegating loader operations to the specified delegate.- Parameters:
loaderDelegate- the delegate to handle loading classes
-
LocalExecutionControl
public LocalExecutionControl()Create an instance using the default class loading.
-
-
Method Details
-
invoke
Description copied from class:DirectExecutionControlInvoke the specified "doit-method", a static method with no parameters. TheDirectExecutionControl.invoke(java.lang.String, java.lang.String)in this class will call this to invoke.- Overrides:
invokein classDirectExecutionControl- Parameters:
doitMethod- the Method to invoke- Returns:
- the value or null
- Throws:
Exception- any exceptions thrown byMethod.invoke(Object, Object...)or anyExecutionControl.ExecutionControlExceptionto pass-through.
-
stop
public void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalExceptionDescription copied from class:DirectExecutionControlInterrupts a running invoke.Not supported.
- Specified by:
stopin interfaceExecutionControl- Overrides:
stopin classDirectExecutionControl- Throws:
ExecutionControl.EngineTerminationException- the execution engine has terminatedExecutionControl.InternalException- an internal problem occurred
-
clientCodeEnter
protected void clientCodeEnter()Description copied from class:DirectExecutionControlMarks entry into user code.- Overrides:
clientCodeEnterin classDirectExecutionControl
-
clientCodeLeave
protected void clientCodeLeave()Description copied from class:DirectExecutionControlMarks departure from user code.- Overrides:
clientCodeLeavein classDirectExecutionControl
-