Class JdiInitiator
java.lang.Object
jdk.jshell.execution.JdiInitiator
Sets up a JDI connection, providing the resulting JDI
VirtualMachine
and the Process the remote agent is running in.- Since:
- 9
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceCallback that should invoked when the remote process is invoked. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocess()Returns the launched process.protected voidrunListenProcess(String jdiAddress, int jshellControlPort, List<String> remoteVMOptions, JdiInitiator.ProcessStarted setupVM) Create a process that will attach to the given address.vm()Returns the resultingVirtualMachineinstance.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Creates and returns a copy of this object.booleanIndicates whether some other object is "equal to" this one.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class<?> getClass()Returns the runtime class of thisObject.inthashCode()Returns a hash code value for this object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
JdiInitiator
public JdiInitiator(int port, List<String> remoteVMOptions, String remoteAgent, boolean isLaunch, String host, int timeout, Map<String, String> customConnectorArgs) Start the remote agent and establish a JDI connection to it.- Parameters:
port- the socket port for (non-JDI) commandsremoteVMOptions- any user requested VM command-line optionsremoteAgent- full class name of remote agent to launchisLaunch- does JDI do the launch? That is, LaunchingConnector, otherwise we start explicitly and use ListeningConnectorhost- explicit hostname to use, if null use discovered hostname, applies to listening only (!isLaunch)timeout- the start-up time-out in milliseconds. If zero or negative, will not wait thus will timeout immediately if not already started.customConnectorArgs- custom arguments passed to the connector. These are JDI com.sun.jdi.connect.Connector arguments. Thevmexecargument is not supported.
-
-
Method Details
-
vm
Returns the resultingVirtualMachineinstance.- Returns:
- the virtual machine
-
process
-
runListenProcess
protected void runListenProcess(String jdiAddress, int jshellControlPort, List<String> remoteVMOptions, JdiInitiator.ProcessStarted setupVM) Create a process that will attach to the given address.- Parameters:
jdiAddress- address on which a JDI server is waiting for a connectionjshellControlPort- the port which the remote agent should connect toremoteVMOptions- VM options for the remote agent VMsetupVM- a callback that should be called then the remote agent process is created. The callback will setup the JDI'sVirtualMachine.- Since:
- 22
-