Module jdk.jdi

Class Connection

java.lang.Object
com.sun.jdi.connect.spi.Connection

public abstract class Connection extends Object
A connection between a debugger and a target VM which it debugs.

A Connection represents a bi-directional communication channel between a debugger and a target VM. A Connection is created when TransportService establishes a connection and successfully handshakes with a target VM. A TransportService implementation provides a reliable JDWP packet transportation service and consequently a Connection provides a reliable flow of JDWP packets between the debugger and the target VM. A Connection is stream oriented, that is, the JDWP packets written to a connection are read by the target VM in the order in which they were written. Similarly packets written to a Connection by the target VM are read by the debugger in the order in which they were written.

A connection is either open or closed. It is open upon creation, and remains open until it is closed. Once closed, it remains closed, and any attempt to invoke an I/O operation upon it will cause a ClosedConnectionException to be thrown. A connection can be tested by invoking the isOpen method.

A Connection is safe for access by multiple concurrent threads, although at most one thread may be reading and at most one thread may be writing at any given time.

Since:
1.5