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()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
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
-