public class JdiInitiator extends Object
VirtualMachine and the Process the remote agent is running in.| Modifier and Type | Class | Description |
|---|---|---|
protected static interface |
JdiInitiator.ProcessStarted |
Callback that should invoked when the remote process is invoked. |
| Constructor | Description |
|---|---|
JdiInitiator |
Start the remote agent and establish a JDI connection to it. |
| Modifier and Type | Method | Description |
|---|---|---|
Process |
process() |
Returns the launched process. |
protected void |
runListenProcess |
Create a process that will attach to the given address. |
VirtualMachine |
vm() |
Returns the resulting VirtualMachine instance. |
public JdiInitiator(int port, List<String> remoteVMOptions, String remoteAgent, boolean isLaunch, String host, int timeout, Map<String,String> customConnectorArgs)
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. The vmexec argument is not supported.public VirtualMachine vm()
VirtualMachine instance.public Process process()
protected void runListenProcess(String jdiAddress, int jshellControlPort, List<String> remoteVMOptions, JdiInitiator.ProcessStarted setupVM)
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's VirtualMachine.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/25/docs/api/jdk.jshell/jdk/jshell/execution/JdiInitiator.html