Connection (Java SE 19 & JDK 19) (original) (raw)


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 whenTransportService 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 aClosedConnectionException 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

Constructors
Constructor for subclasses to call.

abstract void
[close](#close%28%29)()
abstract boolean
[isOpen](#isOpen%28%29)()
Tells whether or not this connection is open.
abstract byte[]
Reads a packet from the target VM.
abstract void
[writePacket](#writePacket%28byte%5B%5D%29)(byte[] pkt)
Writes a packet to the target VM.

Methods declared in class java.lang.Object

[clone](../../../../../../java.base/java/lang/Object.html#clone%28%29), [equals](../../../../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../../../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../../../../java.base/java/lang/Object.html#getClass%28%29), [hashCode](../../../../../../java.base/java/lang/Object.html#hashCode%28%29), [notify](../../../../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../../../../java.base/java/lang/Object.html#notifyAll%28%29), [toString](../../../../../../java.base/java/lang/Object.html#toString%28%29), [wait](../../../../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../../../../java.base/java/lang/Object.html#wait%28long,int%29)