Java Debug Interface

com.sun.jdi.connect
Interface ListeningConnector


public abstract interface ListeningConnector
extends Connector

A connector which listens for a connection initiated by a target VM.

Since:
1.3

Inner classes inherited from class com.sun.jdi.connect.Connector
Connector.Argument, Connector.BooleanArgument, Connector.IntegerArgument, Connector.SelectedArgument, Connector.StringArgument
 
Method Summary
 VirtualMachine accept(java.util.Map arguments)
          Waits for a target VM to attach to this connector.
 java.lang.String startListening(java.util.Map arguments)
          Listens for one or more connections initiated by target VMs.
 void stopListening(java.util.Map arguments)
          Cancels listening for connections.
 boolean supportsMultipleConnections()
          Indicates whether this listening connector supports multiple connections for a single argument map.
 
Methods inherited from interface com.sun.jdi.connect.Connector
defaultArguments, description, name, transport
 

Method Detail

supportsMultipleConnections

public boolean supportsMultipleConnections()
Indicates whether this listening connector supports multiple connections for a single argument map. If so, a call to startListening(java.util.Map) may allow multiple target VM to become connected.
Returns:
true if multiple connections are supported; false otherwise.

startListening

public java.lang.String startListening(java.util.Map arguments)
                                throws java.io.IOException,
                                       IllegalConnectorArgumentsException
Listens for one or more connections initiated by target VMs. The connector uses the given argument map in determining the address at which to listen or else it generates an appropriate listen address. In either case, an address string is returned from this method which can be used in starting target VMs to identify this this connector. The format of the address string is connector, transport, and, possibly, platform dependent.

The argument map associates argument name strings to instances of Connector.Argument. The default argument map for a connector can be obtained through Connector.defaultArguments(). Argument map values can be changed, but map entries should not be added or deleted.

This method does not return a VirtualMachine, and, normally, returns before any target VM initiates a connection. The connected target is obtained through accept(java.util.Map) (using the same argument map as is passed to this method).

Returns:
the address at which the connector is listening for a connection.
Throws:
java.io.IOException - when unable to start listening. Specific exceptions are dependent on the Connector implementation in use.
IllegalConnectorArgumentsException - when one of the connector arguments is invalid.

stopListening

public void stopListening(java.util.Map arguments)
                   throws java.io.IOException,
                          IllegalConnectorArgumentsException
Cancels listening for connections. The given argument map should match the argument map given for a previous startListening(java.util.Map) invocation.
Throws:
java.io.IOException - when unable to stop listening. Specific exceptions are dependent on the Connector implementation in use.
IllegalConnectorArgumentsException - when one of the connector arguments is invalid.

accept

public VirtualMachine accept(java.util.Map arguments)
                      throws java.io.IOException,
                             IllegalConnectorArgumentsException
Waits for a target VM to attach to this connector.
Throws:
java.io.IOException - when unable to accept. Specific exceptions are dependent on the Connector implementation in use.
IllegalConnectorArgumentsException - when one of the connector arguments is invalid.

Java Debug Interface