A transport service is a concrete subclass of this class
that has a zero-argument constructor and implements the abstract
methods specified below. It is the underlying service
used by a Transport for connections between a debugger
and a target VM.
A transport service is used to establish a connection between a debugger and a target VM, and to transport Java Debug Wire Protocol (JDWP) packets over an underlying communication protocol. In essence a transport service implementation binds JDWP (as specified in the JDWP specification) to an underlying communication protocol. A transport service implementation provides a reliable JDWP packet transportation service. JDWP packets are sent to and from the target VM without duplication or data loss. A transport service implementation may be based on an underlying communication protocol that is reliable or unreliable. If the underlying communication protocol is reliable then the transport service implementation may be relatively simple and may only need to transport JDWP packets as payloads of the underlying communication protocol. In the case of an unreliable communication protocol the transport service implementation may include additional protocol support in order to ensure that packets are not duplicated and that there is no data loss. The details of such protocols are specific to the implementation but may involve techniques such as the positive acknowledgment with retransmission technique used in protocols such as the Transmission Control Protocol (TCP) (see RFC 793 ).
A transport service can be used to initiate a connection
to a target VM. This is done by invoking the attach
method. Alternatively, a transport service can listen and
accept connections initiated by a target VM. This is done
by invoking the startListening(String) method to
put the transport into listen mode. Then the accept
method is used to accept a connection initiated by a
target VM.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | TransportService.
The transport service capabilities. |
| public abstract static class | TransportService.
A listen key. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Connection | Returns: The Connection representing the bi-directional communication channel to the target VM.A listen key obtained from a previous call to listenKey,startListening(String) or startListening().if this transport service supports an accept timeout, and
if acceptTimeout, long acceptTimeout is positive then block for up to
acceptTimeout milliseconds, more or less, while waiting
for the target VM to connect.
If the transport service does not support an accept timeout
or if acceptTimeout is zero then block indefinitely
for a target VM to connect.If this transport service supports a handshake timeout,
and if handshakeTimeout)handshakeTimeout is positive, then it
specifies the timeout, in milliseconds (more or less), to
use when handshaking with the target VM. The exact
usage of the timeout is specific to the transport service.
A transport service may, for example, use the handshake
timeout as the inter-character timeout while waiting for
the JDWP-Handshake message from the target VM.
Alternatively, a transport service may, for example,
use the timeout as a timeout for the duration of the
handshake exchange.
If the transport service does not support a handshake
timeout, of if handshakeTimeout is specified
as zero then the handshake does not timeout if there
isn't a response from the target VM.Accept a connection from a target VM. |
| public abstract Connection | Returns: The Connection representing the bi-directional communication channel to the target VM.The address of the target VM. address, long If this transport service supports an attach timeout,
and if attachTimeout, long attachTimeout is positive, then it specifies
the timeout, in milliseconds (more or less), to use
when attaching to the target VM. If the transport service
does not support an attach timeout, or if attachTimeout
is specified as zero then attach without any timeout.If this transport service supports a handshake timeout,
and if handshakeTimeout)handshakeTimeout is positive, then it
specifies the timeout, in milliseconds (more or less), to
use when handshaking with the target VM. The exact
usage of the timeout are specific to the transport service.
A transport service may, for example, use the handshake
timeout as the inter-character timeout while waiting for
the JDWP-Handshake message from the target VM.
Alternatively, a transport service may, for example,
use the handshakeTimeout as a timeout for the duration of the
handshake exchange.
If the transport service does not support a handshake
timeout, or if handshakeTimeout is specified
as zero then the handshake does not timeout if there
isn't a response from the target VM.Attaches to the specified address. |
| public abstract TransportService. | Returns: the transport service capabilitiesReturns the capabilities of the transport service. |
| public abstract String | Returns: The description of the transport serviceReturns a description of the transport service. |
| public abstract String | |
| public abstract TransportService. | startListening(String
The address to start listening for connections,
or address)null to listen on an address chosen
by the transport service.Listens on the specified address for inbound connections. |
| public abstract TransportService. | |
| public abstract void | stopListening(TransportService.
The listen key obtained from a previous call to listenKeystartListening(String) or startListening().Stop listening for inbound connections. |
| TransportService | back to summary |
|---|---|
| public TransportService() Constructor for subclasses to call. | |
| accept | back to summary |
|---|---|
| public abstract Connection accept(TransportService. Accept a connection from a target VM. Waits (indefinitely or with timeout) to accept a connection from a target VM. Returns a connection representing the bi-directional communication channel to the target VM. Accepting a connection from a target VM involves two steps. First, the transport service waits to accept the connection from the target VM. Once the connection is established a handshake is performed to ensure that the connection is indeed to a target VM. The handshake involves the exchange of a string JDWP-Handshake as specified in the Java Debug Wire Protocol specification.
| |
| attach | back to summary |
|---|---|
| public abstract Connection attach(String address, long attachTimeout, long handshakeTimeout) throws IOException Attaches to the specified address. Attaches to the specified address and returns a connection representing the bi-directional communication channel to the target VM. Attaching to the target VM involves two steps: First, a connection is established to specified address. This is followed by a handshake to ensure that the connection is to a target VM. The handshake involves the exchange of a string JDWP-Handshake as specified in the Java Debug Wire Protocol specification.
| |
| capabilities | back to summary |
|---|---|
| public abstract TransportService. Returns the capabilities of the transport service.
| |
| description | back to summary |
|---|---|
| public abstract String description() Returns a description of the transport service.
| |
| name | back to summary |
|---|---|
| public abstract String name() Returns a name to identify the transport service.
| |
| startListening | back to summary |
|---|---|
| public abstract TransportService. Listens on the specified address for inbound connections. This method starts the transport service listening on the specified address so that it can subsequently accept an inbound connection. It does not wait until an inbound connection is established.
| |
| startListening | back to summary |
|---|---|
| public abstract TransportService. Listens on an address chosen by the transport service. This convenience method works as if by invoking
| |
| stopListening | back to summary |
|---|---|
| public abstract void stopListening(TransportService. Stop listening for inbound connections. Invoking this method while another thread is blocked
in
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract boolean | Returns: true if, and only if, this transport
service supports timeout while waiting for
a target VM to connect.Tell whether or not this transport service supports a timeout while waiting for a target VM to connect. |
| public abstract boolean | Returns: true if, and only if, this transport
service supports attaching with a timeout.Tell whether or not this transport service supports a timeout when attaching to a target VM. |
| public abstract boolean | Returns: true if, and only if, this transport
service supports a timeout while handshaking
with the target VM.Tells whether or not this transport service supports a timeout when handshaking with the target VM. |
| public abstract boolean | Returns: true if, and only if, this transport
service supports multiple connections.Tells whether or not this transport service can support multiple concurrent connections to a single address that it is listening on. |
| Capabilities | back to summary |
|---|---|
| public Capabilities() Constructor for subclasses to call. | |
| supportsAcceptTimeout | back to summary |
|---|---|
| public abstract boolean supportsAcceptTimeout() Tell whether or not this transport service supports a timeout while waiting for a target VM to connect.
| |
| supportsAttachTimeout | back to summary |
|---|---|
| public abstract boolean supportsAttachTimeout() Tell whether or not this transport service supports a timeout when attaching to a target VM.
| |
| supportsHandshakeTimeout | back to summary |
|---|---|
| public abstract boolean supportsHandshakeTimeout() Tells whether or not this transport service supports a timeout when handshaking with the target VM.
| |
| supportsMultipleConnections | back to summary |
|---|---|
| public abstract boolean supportsMultipleConnections() Tells whether or not this transport service can support multiple concurrent connections to a single address that it is listening on.
| |
A TransportService may listen on multiple, yet
different, addresses at the same time. To uniquely identify
each listener a listen key is created each time that
startListening is called. The listen
key is used in calls to the accept method
to accept inbound connections to that listener. A listen
key is valid until it is used as an argument to stopListening to stop the transport
service from listening on an address.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract String |
| ListenKey | back to summary |
|---|---|
| public ListenKey() Constructor for subclasses to call. | |
| address | back to summary |
|---|---|
| public abstract String address() Returns a string representation of the listen key. | |