- java.lang.Object
-
- jdk.jshell.execution.StreamingExecutionControl
-
- jdk.jshell.execution.JdiExecutionControl
-
- jdk.jshell.execution.JdiDefaultExecutionControl
-
- All Implemented Interfaces:
-
AutoCloseable,ExecutionControl
public class JdiDefaultExecutionControl extends JdiExecutionControl
默认情况下,JShell-core的使用实现为ExecutionControl。 启动远程进程 - “远程代理”。 通过套接字和通过JDI与远程代理接口。 设计使用RemoteExecutionControl。- 从以下版本开始:
- 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
-
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 voidclose()关闭执行引擎。Stringinvoke(String classname, String methodname)通过调用指定的包装类上的方法来调用可执行代码段。voidstop()通过操作远程变量并通过JDI发送停止来中断正在运行的远程调用。protected VirtualMachinevm()返回JDIVirtualMachine实例。-
Methods inherited from interface jdk.jshell.spi.ExecutionControl
addToClasspath, extensionCommand, generate, generate, load, varValue
-
Methods inherited from class jdk.jshell.execution.JdiExecutionControl
redefine, referenceType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class jdk.jshell.execution.StreamingExecutionControl
addToClasspath, extensionCommand, load, varValue
-
-
-
-
方法详细信息
-
invoke
public String invoke(String classname, String methodname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException
说明从接口ExecutionControl复制通过调用指定的包装类上的方法来调用可执行代码段。 该方法必须没有参数并返回String。- Specified by:
-
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发送停止来中断正在运行的远程调用。- Specified by:
-
stop在接口ExecutionControl - 重写:
-
stop在StreamingExecutionControl - 异常
-
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题
-
close
public void close()
说明从类别复制:StreamingExecutionControl关闭执行引擎。 发送退出命令到远程代理。- Specified by:
-
close在接口AutoCloseable - Specified by:
-
close在接口ExecutionControl - 重写:
-
close在StreamingExecutionControl类
-
vm
protected VirtualMachine vm() throws ExecutionControl.EngineTerminationException
描述从类别复制:JdiExecutionControl返回JDIVirtualMachine实例。- Specified by:
-
vm在JdiExecutionControl - 结果
- 虚拟机
- 异常
-
ExecutionControl.EngineTerminationException- 如果虚拟机死机/断开连接
-
-