| 
Java Debug Interface | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A manager of connections to target virtual machines. The
 VirtualMachineManager allows one application to debug
 multiple target VMs. (Note that the converse is not
 supported; a target VM can be debugged by only one
 debugger application.) This interface
 contains methods to manage connections
 to remote target VMs and to obtain the VirtualMachine
 mirror for available target VMs.
 
 Connections can be made using one of several different
 Connector objects. Each connector encapsulates
 a different way of connecting the debugger with a target VM.
 
 The VirtualMachineManager supports many different scenarios for
 connecting a debugger to a virtual machine. Four examples
 are presented in the table below. The
 examples use the command line syntax in Sun's classic VM.
 Some Connector implementations may require slightly
 different handling than presented below.
 
| Scenario | Description | 
|---|---|
| Debugger launches target VM (simplest, most-common scenario) | Debugger calls the
 LaunchingConnector.launch(java.util.Map)
 method of the default connector, obtained with defaultConnector(). The
 target VM is launched, and a connection between that VM and the
 debugger is established. A VirtualMachine mirror is returned.
 Or, for more control 
  | 
 
| Debugger attaches to previously-running VM | 
 
  | 
 
| Target VM attaches to previously-running debugger | 
 listeningConnectors() for one or more
 transports.ListeningConnector.startListening(java.util.Map) method for each selected
 connector. For each call, a transport-specific address string is
 generated and returned. The debugger makes the transport names and
 corresponding address strings available to the end user.
 ListeningConnector.accept(java.util.Map)
 for each selected connector to wait for
 a target VM to connect.-Xrunjdwp:transport=xxx,address=yyy  -Xdebug -Xnoagent -Djava.compiler=NONE
 where "xxx" the transport for one of the connectors selected by the
 the debugger and "yyy"
 is the address generated by
 ListeningConnector.accept(java.util.Map) for that
 transport.ListeningConnector.accept(java.util.Map) returns
 a VirtualMachine mirror. | 
 
| Target VM launches debugger (sometimes called "Just-In-Time" debugging) | 
 -Xrunjdwp:launch=cmdline,onuncaught=y,transport=xxx,server=y
 
 attachingConnectors() matching the transport with
 the name "xxx".
 Connector.defaultArguments()) to specify
 the transport specific address at which the VM is listenig. Optionally,
 other connector arguments can be presented to the user.
 AttachingConnector.attach(java.util.Map) method
 of the selected to attach to the target VM. A VirtualMachine
 mirror is returned.
  | 
 
| Method Summary | |
 List | 
allConnectors()
Returns the list of all known Connector objects. | 
 List | 
attachingConnectors()
Returns the list of known AttachingConnector objects. | 
 List | 
connectedVirtualMachines()
Lists all target VMs which are connected to the debugger.  | 
 LaunchingConnector | 
defaultConnector()
Identifies the default connector.  | 
 List | 
launchingConnectors()
Returns the list of known LaunchingConnector objects. | 
 List | 
listeningConnectors()
Returns the list of known ListeningConnector objects. | 
 int | 
majorInterfaceVersion()
Returns the major version number of the JDI interface.  | 
 int | 
minorInterfaceVersion()
Returns the minor version number of the JDI interface.  | 
| Method Detail | 
public LaunchingConnector defaultConnector()
LaunchingConnectorpublic List launchingConnectors()
LaunchingConnector objects.
 Any of the returned objects can be used to launch a new target
 VM and immediately create a VirtualMachine mirror for it.
 Note that a target VM launched by a launching connector is not
 guaranteed to be stable until after the VMStartEvent has been
 received.
LaunchingConnector objects.public List attachingConnectors()
AttachingConnector objects.
 Any of the returned objects can be used to attach to an existing target
 VM and create a VirtualMachine mirror for it.
AttachingConnector objects.public List listeningConnectors()
ListeningConnector objects.
 Any of the returned objects can be used to listen for a
 connection initiated by a target VM
 and create a VirtualMachine mirror for it.
ListeningConnector objects.public List allConnectors()
public List connectedVirtualMachines()
VirtualMachine instances for
 any target VMs which initiated a connection
 and any
 target VMs to which this manager has initiated a connection.
 A target VM will remain in this list
 until the VM is disconnected.
 VMDisconnectEvent is placed in the event queue
 after the VM is removed from the list.
VirtualMachine objects, each mirroring
 a target VM.public int majorInterfaceVersion()
VirtualMachine.version() target VM version and
 information and
 VirtualMachine.description() more version information.
public int minorInterfaceVersion()
VirtualMachine.version() target VM version and
 information and
 VirtualMachine.description() more version information.
  | 
Java Debug Interface | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||