LocalExecutionControl (Java SE 9 & JDK 9 )
Keywords: jdk.jshell.execution.LocalExecutionControl class

Module jdk.jshell
Package jdk.jshell.execution

## Class LocalExecutionControl

- java.lang.Object
- - jdk.jshell.execution.DirectExecutionControl
  - - jdk.jshell.execution.LocalExecutionControl

- All Implemented Interfaces:
    `AutoCloseable`, `ExecutionControl`

      public class LocalExecutionControl
      extends DirectExecutionControl

  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

    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 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.
    `void` | `stop​()` | 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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: `DirectExecutionControl`
      Invoke the specified "doit-method", a static method with no parameters. The `DirectExecutionControl.invoke(java.lang.String, java.lang.String)` in this class will call this to invoke.
      Overrides:
        `invoke` in class `DirectExecutionControl`
      Parameters:
        `doitMethod` - the Method to invoke
      Returns:
        the value or null
      Throws:
        `Exception` - any exceptions thrown by `Method.invoke(Object, Object...)` or any `ExecutionControl.ExecutionControlException` to pass-through.

    - #### stop

          public void stop​()
                    throws ExecutionControl.EngineTerminationException,
                           ExecutionControl.InternalException

      Description copied from class: `DirectExecutionControl`
      Interrupts a running invoke.

      Not supported.

      Specified by:
        `stop` in interface `ExecutionControl`
      Overrides:
        `stop` in class `DirectExecutionControl`
      Throws:
        `ExecutionControl.EngineTerminationException` - the execution engine has terminated
        `ExecutionControl.InternalException` - an internal problem occurred

    - #### clientCodeEnter

          protected void clientCodeEnter​()

      Description copied from class: `DirectExecutionControl`
      Marks entry into user code.
      Overrides:
        `clientCodeEnter` in class `DirectExecutionControl`

    - #### clientCodeLeave

          protected void clientCodeLeave​()

      Description copied from class: `DirectExecutionControl`
      Marks departure from user code.
      Overrides:
        `clientCodeLeave` in class `DirectExecutionControl`