java.lang.Object
jdk.jshell.execution.StreamingExecutionControl
- 所有已实现的接口:
-
AutoCloseable,ExecutionControl
- 直接已知的子类:
-
JdiExecutionControl
实现了将请求流式传输到远程代理的
ExecutionControl执行引擎SPI的实现,执行在那里进行。
- 自:
- 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToClasspath(String path) 将路径添加到执行类路径。voidclose()关闭执行引擎。extensionCommand(String command, Object arg) 运行非标准命令(或来自更新版本的标准命令)。通过在指定的包装类上调用方法来调用可执行片段。voidload(ExecutionControl.ClassBytecodes[] cbcs) 尝试加载新类。void尝试重新定义先前加载的类。voidstop()中断正在运行的调用。返回变量的值。
-
Constructor Details
-
StreamingExecutionControl
创建一个实例。- 参数:
-
out- 命令的输出 -
in- 命令响应的输入
-
-
Method Details
-
load
public void load(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException 从接口复制的描述:ExecutionControl尝试加载新类。- 指定者:
-
load在接口ExecutionControl - 参数:
-
cbcs- 要加载的类名和字节码 - 抛出:
-
ExecutionControl.ClassInstallException- 加载类时发生异常,一些或全部类未加载 -
ExecutionControl.NotImplementedException- 如果未实现 -
ExecutionControl.EngineTerminationException- 执行引擎已终止
-
redefine
public void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException 从接口复制的描述:ExecutionControl尝试重新定义先前加载的类。- 指定者:
-
redefine在接口ExecutionControl - 参数:
-
cbcs- 要重新定义的类名和字节码 - 抛出:
-
ExecutionControl.ClassInstallException- 重新定义类时发生异常,一些或全部类未重新定义 -
ExecutionControl.NotImplementedException- 如果未实现 -
ExecutionControl.EngineTerminationException- 执行引擎已终止
-
invoke
public String invoke(String classname, String methodname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException 从接口复制的描述:ExecutionControl通过在指定的包装类上调用方法来调用可执行片段。该方法必须没有参数并返回String。- 指定者:
-
invoke在接口ExecutionControl - 参数:
-
classname- 应调用其方法的类 -
methodname- 要调用的方法的名称 - 返回:
- 执行结果或如果没有结果则为null
- 抛出:
-
ExecutionControl.UserException- 调用引发了用户异常 -
ExecutionControl.ResolutionException- 调用尝试直接或间接调用未解析的片段 -
ExecutionControl.StoppedException- 如果invoke()被ExecutionControl.stop()取消 -
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题 -
ExecutionControl.RunException
-
varValue
public String varValue(String classname, String varname) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException 从接口复制的描述:ExecutionControl返回变量的值。- 指定者:
-
varValue在接口ExecutionControl - 参数:
-
classname- 变量的包装类名称 -
varname- 变量的名称 - 返回:
- 变量的值
- 抛出:
-
ExecutionControl.UserException- 格式化值引发了用户异常 -
ExecutionControl.ResolutionException- 格式化值尝试直接或间接调用未解析的片段 -
ExecutionControl.StoppedException- 如果取消了格式化值的操作ExecutionControl.stop() -
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题 -
ExecutionControl.RunException
-
addToClasspath
public void addToClasspath(String path) throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException 从接口复制的描述:ExecutionControl将路径添加到执行类路径。- 指定者:
-
addToClasspath在接口ExecutionControl - 参数:
-
path- 要添加的路径 - 抛出:
-
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题
-
stop
public void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException从接口复制的描述:ExecutionControl中断正在运行的调用。- 指定者:
-
stop在接口ExecutionControl - 抛出:
-
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.InternalException- 发生内部问题
-
extensionCommand
public Object extensionCommand(String command, Object arg) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException 从接口复制的描述:ExecutionControl运行非标准命令(或来自更新版本的标准命令)。- 指定者:
-
extensionCommand在接口ExecutionControl - 参数:
-
command- 非标准命令 -
arg- 命令参数 - 返回值:
- 命令的返回值
- 抛出:
-
ExecutionControl.UserException- 命令引发用户异常 -
ExecutionControl.ResolutionException- 命令尝试直接或间接调用未解析的片段 -
ExecutionControl.StoppedException- 如果命令被ExecutionControl.stop()取消 -
ExecutionControl.EngineTerminationException- 执行引擎已终止 -
ExecutionControl.NotImplementedException- 如果未实现 -
ExecutionControl.InternalException- 发生内部问题 -
ExecutionControl.RunException
-
close
public void close()关闭执行引擎。向远程代理发送退出命令。- 指定者:
-
close在接口AutoCloseable - 指定者:
-
close在接口ExecutionControl
-