java.lang.Object
jdk.jshell.execution.StreamingExecutionControl
jdk.jshell.execution.JdiExecutionControl
- 所有已实现的接口:
-
AutoCloseable
,ExecutionControl
- 直接已知的子类:
-
JdiDefaultExecutionControl
public abstract class JdiExecutionControl extends StreamingExecutionControl implements ExecutionControl
ExecutionControl的抽象JDI实现。
- 自JDK版本:
- 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
ModifierConstructorDescriptionprotected
JdiExecutionControl
(ObjectOutput out, ObjectInput in) 创建一个实例。 -
Method Summary
Modifier and TypeMethodDescriptionvoid
重新定义指定的类。protected ReferenceType
referenceType
(VirtualMachine vm, String name) 返回与指定类名对应的JDIReferenceType
。protected abstract VirtualMachine
vm()
返回JDIVirtualMachine
实例。Methods declared in class jdk.jshell.execution.StreamingExecutionControl
addToClasspath, close, extensionCommand, invoke, load, stop, varValue
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface jdk.jshell.spi.ExecutionControl
addToClasspath, close, extensionCommand, invoke, load, stop, varValue
-
Constructor Details
-
JdiExecutionControl
创建一个实例。- 参数:
-
out
- 来自远程代理的输出 -
in
- 发送到远程代理的输入
-
-
Method Details
-
vm
返回JDIVirtualMachine
实例。- 返回:
- 虚拟机
- 抛出:
-
ExecutionControl.EngineTerminationException
- 如果虚拟机已死机/断开连接
-
redefine
public void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException 重新定义指定的类。其中'redefine'是指JDI和JVMTI中的就地替换类(保留类标识)--也就是说,对类的现有引用不需要重新编译。此实现使用JDIVirtualMachine.redefineClasses(java.util.Map)
。如果类的签名已更改(请参阅JDI规范),则将无法成功。JShell核心被设计为适应重新定义失败。- 指定者:
-
redefine
在接口ExecutionControl
- 参数:
-
cbcs
- 要重新定义的类名和字节码 - 抛出:
-
ExecutionControl.ClassInstallException
- 重新定义类时发生异常,一些或全部类未被重新定义 -
ExecutionControl.EngineTerminationException
- 执行引擎已终止
-
referenceType
返回与指定类名对应的JDIReferenceType
。- 参数:
-
vm
- 由vm()
返回的当前JDIVirtualMachine
-
name
- 要查找的类名 - 返回:
-
相应的
ReferenceType
-