APIdia Launch Partner
Top Fields Constructors Methods
com.sun.tools.jdi

public Class GenericListeningConnector

extends ConnectorImpl
implements ListeningConnector
Class Inheritance
All Implemented Interfaces
com.sun.jdi.connect.ListeningConnector, com.sun.jdi.connect.Connector
Known Direct Subclasses
com.sun.tools.jdi.SocketListeningConnector
Imports
java.io.IOException, java.util.ArrayList, .HashMap, .Map, com.sun.jdi.Bootstrap, .VirtualMachine, com.sun.jdi.connect.Connector, .IllegalConnectorArgumentsException, .ListeningConnector, .Transport, com.sun.jdi.connect.spi.Connection, .TransportService

Field Summary

Modifier and TypeField and Description
pack-priv static final String
pack-priv static final String
pack-priv Map<Map<String, ? extends Connector.Argument>, TransportService.ListenKey>
pack-priv Transport
pack-priv TransportService
Inherited from com.sun.tools.jdi.ConnectorImpl:
defaultArgumentsfalseStringtrueString

Constructor Summary

AccessConstructor and Description
private
GenericListeningConnector(TransportService ts, boolean addAddressArgument)

Initialize a new instance of this connector.

protected
GenericListeningConnector(TransportService ts)

Initialize a new instance of this connector.

Method Summary

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

Implements com.sun.jdi.connect.ListeningConnector.accept.

Waits for a target VM to attach to this connector.

public static GenericListeningConnector
create(TransportService ts)

Create an instance of this Connector.

public String
description()

Implements com.sun.jdi.connect.Connector.description.

Returns a human-readable description of this connector and its purpose.

public String
name()

Implements com.sun.jdi.connect.Connector.name.

Returns a short identifier for the connector.

public String
startListening(String address, Map<String, ? extends Connector.Argument> args)

public String
startListening(Map<String, ? extends Connector.Argument> args)

Implements com.sun.jdi.connect.ListeningConnector.startListening.

Listens for one or more connections initiated by target VMs.

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

Implements com.sun.jdi.connect.ListeningConnector.stopListening.

Cancels listening for connections.

public boolean
supportsMultipleConnections()

Implements com.sun.jdi.connect.ListeningConnector.supportsMultipleConnections.

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

public Transport
transport()

Implements com.sun.jdi.connect.Connector.transport.

Returns the transport mechanism used by this connector to establish connections with a target VM.

protected void
Inherited from com.sun.tools.jdi.ConnectorImpl:
addBooleanArgumentaddIntegerArgumentaddSelectedArgumentaddStringArgumentargumentdefaultArgumentsgetStringtoString

Field Detail

ARG_ADDRESSback to summary
pack-priv static final String ARG_ADDRESS
ARG_TIMEOUTback to summary
pack-priv static final String ARG_TIMEOUT
listenMapback to summary
pack-priv Map<Map<String, ? extends Connector.Argument>, TransportService.ListenKey> listenMap
transportback to summary
pack-priv Transport transport
transportServiceback to summary
pack-priv TransportService transportService

Constructor Detail

GenericListeningConnectorback to summary
private GenericListeningConnector(TransportService ts, boolean addAddressArgument)

Initialize a new instance of this connector. The connector encapsulates a transport service, has a "timeout" connector argument, and optionally an "address" connector argument.

GenericListeningConnectorback to summary
protected GenericListeningConnector(TransportService ts)

Initialize a new instance of this connector. This constructor is used when sub-classing - the resulting connector will a "timeout" connector argument.

Method Detail

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

Implements com.sun.jdi.connect.ListeningConnector.accept.

Doc from com.sun.jdi.connect.ListeningConnector.accept.

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.
createback to summary
public static GenericListeningConnector create(TransportService ts)

Create an instance of this Connector. The resulting ListeningConnector will have "address" and "timeout" connector arguments.

descriptionback to summary
public String description()

Implements com.sun.jdi.connect.Connector.description.

Doc from com.sun.jdi.connect.Connector.description.

Returns a human-readable description of this connector and its purpose.

nameback to summary
public String name()

Implements com.sun.jdi.connect.Connector.name.

Doc from com.sun.jdi.connect.Connector.name.

Returns a short identifier for the connector. Connector implementors should follow similar naming conventions as are used with packages to avoid name collisions. For example, the Sun connector implementations have names prefixed with "com.sun.jdi.". Not intended for exposure to end-user.

startListeningback to summary
public String startListening(String address, Map<String, ? extends Connector.Argument> args) throws IOException, IllegalConnectorArgumentsException
startListeningback to summary
public String startListening(Map<String, ? extends Connector.Argument> args) throws IOException, IllegalConnectorArgumentsException

Implements com.sun.jdi.connect.ListeningConnector.startListening.

Doc from com.sun.jdi.connect.ListeningConnector.startListening.

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.

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> args) throws IOException, IllegalConnectorArgumentsException

Implements com.sun.jdi.connect.ListeningConnector.stopListening.

Doc from com.sun.jdi.connect.ListeningConnector.stopListening.

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()

Implements com.sun.jdi.connect.ListeningConnector.supportsMultipleConnections.

Doc from com.sun.jdi.connect.ListeningConnector.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.

transportback to summary
public Transport transport()

Implements com.sun.jdi.connect.Connector.transport.

Doc from com.sun.jdi.connect.Connector.transport.

Returns the transport mechanism used by this connector to establish connections with a target VM.

updateArgumentMapIfRequiredback to summary
protected void updateArgumentMapIfRequired(Map<String, ? extends Connector.Argument> args, TransportService.ListenKey listener)