java.lang.Object
jdk.jshell.execution.StreamingExecutionControl
jdk.jshell.execution.JdiExecutionControl
jdk.jshell.execution.JdiDefaultExecutionControl
- 所有已实现的接口:
-
AutoCloseable,ExecutionControl
JShell核心默认使用的
ExecutionControl的实现。启动一个远程进程 -- "远程代理"。通过套接字和JDI与远程代理进行接口交互。设计用于与RemoteExecutionControl一起使用。
- 自版本:
- 9
-
Nested Class Summary
Nested classes/interfaces declared in 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()关闭执行引擎。通过调用指定包装类的方法来调用可执行片段。voidstop()通过操作远程变量并通过JDI发送停止信号来中断正在运行的远程调用。protected VirtualMachinevm()返回JDIVirtualMachine实例。Methods declared in class jdk.jshell.execution.JdiExecutionControl
redefine, referenceTypeMethods declared in class jdk.jshell.execution.StreamingExecutionControl
addToClasspath, close, extensionCommand, load, varValueMethods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface jdk.jshell.spi.ExecutionControl
addToClasspath, extensionCommand, load, varValue
-
Method Details
-
invoke
public String invoke(String classname, String methodname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException 从接口复制的描述:ExecutionControl通过调用指定包装类的方法来调用可执行片段。该方法必须没有参数并返回String。- 指定者:
-
invoke在接口ExecutionControl - 覆盖:
-
invoke在类StreamingExecutionControl - 参数:
-
classname- 应调用其方法的类 -
methodname- 要调用的方法的名称 - 返回:
- 执行结果或如果没有结果则为null
- 抛出:
-
ExecutionControl.UserException- 调用引发了用户异常 -
ExecutionControl.ResolutionException- 调用尝试直接或间接调用未解析的片段 -
ExecutionControl.StoppedException- 如果invoke()被ExecutionControl.stop()取消 -
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题 -
ExecutionControl.RunException
-
stop
public void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException通过操作远程变量并通过JDI发送停止信号来中断正在运行的远程调用。- 抛出:
-
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题
-
close
public void close()从类复制的描述:StreamingExecutionControl关闭执行引擎。向远程代理发送退出命令。- 指定者:
-
close在接口AutoCloseable - 指定者:
-
close在接口ExecutionControl - 覆盖:
-
close在类StreamingExecutionControl
-
vm
从类复制的描述:JdiExecutionControl返回JDIVirtualMachine实例。- 指定者:
-
vm在类JdiExecutionControl - 返回:
- 虚拟机
- 抛出:
-
ExecutionControl.EngineTerminationException- 如果虚拟机已死亡/断开连接
-