- java.lang.Object
-
- jdk.jshell.execution.DirectExecutionControl
-
- jdk.jshell.execution.LocalExecutionControl
-
- All Implemented Interfaces:
AutoCloseable,ExecutionControl
public class LocalExecutionControl extends DirectExecutionControl
An implementation ofExecutionControlwhich 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
Constructors Constructor Description LocalExecutionControl()Create an instance using the default class loading.LocalExecutionControl(LoaderDelegate loaderDelegate)Creates an instance, delegating loader operations to the specified delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclientCodeEnter()Marks entry into user code.protected voidclientCodeLeave()Marks departure from user code.protected Stringinvoke(Method doitMethod)Invoke the specified "doit-method", a static method with no parameters.voidstop()Interrupts a running invoke.-
Methods inherited from class jdk.jshell.execution.DirectExecutionControl
addToClasspath, classesRedefined, close, extensionCommand, findClass, invoke, load, redefine, throwConvertedInvocationException, throwConvertedOtherException, valueString, varValue
-
Methods inherited from interface jdk.jshell.spi.ExecutionControl
generate, generate
-
-
-
-
Constructor Detail
-
LocalExecutionControl
public LocalExecutionControl(LoaderDelegate loaderDelegate)
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 Detail
-
invoke
protected String invoke(Method doitMethod) throws Exception
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
-
-