APIdia Launch Partner
Top Description Methods
com.sun.jdi.connect

public Interface ListeningConnector

extends Connector
Known Direct Implementers
com.sun.tools.jdi.GenericListeningConnector
Imports
java.io.IOException, java.util.Map, com.sun.jdi.VirtualMachine

A connector which listens for a connection initiated by a target VM.
Author
Gordon Hirsch
Since
1.3

Method Summary

Modifier and TypeMethod and Description
public VirtualMachine
accept(Map<String, ? extends Connector.Argument> arguments)

Waits for a target VM to attach to this connector.

public String

Returns:

the address at which the connector is listening for a connection.
startListening
(Map<String, ? extends Connector.Argument> arguments)

Listens for one or more connections initiated by target VMs.

public void
stopListening(Map<String, ? extends Connector.Argument> arguments)

Cancels listening for connections.

public boolean

Returns:

true if multiple connections are supported; false otherwise.
supportsMultipleConnections
()

Indicates whether this listening connector supports multiple connections for a single argument map.

Inherited from com.sun.jdi.connect.Connector:
defaultArgumentsdescriptionnametransport

Method Detail

acceptback to summary
public VirtualMachine accept(Map<String, ? extends Connector.Argument> arguments) throws IOException, IllegalConnectorArgumentsException

Waits for a target VM to attach to this connector.

Exceptions
IOException:
when unable to accept. Specific exceptions are dependent on the Connector implementation in use.
IllegalConnectorArgumentsException:
when one of the connector arguments is invalid.
TransportTimeoutException:
when the Connector encapsulates a transport that supports a timeout when accepting, a Connector.Argument representing a timeout has been set in the argument map, and a timeout occurs whilst waiting for the target VM to connect.
startListeningback to summary
public String startListening(Map<String, ? extends Connector.Argument> arguments) throws 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 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 (using the same argument map as is passed to this method).

If arguments contains addressing information and only one connection will be accepted, the accept method can be called immediately without calling this method.

Returns:String

the address at which the connector is listening for a connection.

Exceptions
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.
stopListeningback to summary
public void stopListening(Map<String, ? extends Connector.Argument> arguments) throws IOException, IllegalConnectorArgumentsException

Cancels listening for connections. The given argument map should match the argument map given for a previous startListening invocation.

Exceptions
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.
supportsMultipleConnectionsback to summary
public boolean supportsMultipleConnections()

Indicates whether this listening connector supports multiple connections for a single argument map. If so, a call to startListening may allow multiple target VM to become connected.

Returns:boolean

true if multiple connections are supported; false otherwise.