Package org.jgroups.blocks.cs
Class Connection
- java.lang.Object
-
- org.jgroups.blocks.cs.Connection
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
NioConnection
,TcpConnection
public abstract class Connection extends java.lang.Object implements java.io.Closeable
Represents a connection to a peer
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]
cookie
protected long
last_access
protected Address
peer_addr
-
Constructor Summary
Constructors Constructor Description Connection()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
connect(Address dest)
abstract boolean
isConnected()
abstract boolean
isConnectionPending()
abstract boolean
isExpired(long millis)
abstract boolean
isOpen()
abstract Address
localAddress()
abstract Address
peerAddress()
abstract void
send(byte[] buf, int offset, int length)
abstract void
send(java.nio.ByteBuffer buf)
abstract void
start()
abstract java.lang.String
status()
-
-
-
Field Detail
-
cookie
public static final byte[] cookie
-
peer_addr
protected Address peer_addr
-
last_access
protected long last_access
-
-
Method Detail
-
isOpen
public abstract boolean isOpen()
-
isConnected
public abstract boolean isConnected()
-
isConnectionPending
public abstract boolean isConnectionPending()
-
localAddress
public abstract Address localAddress()
-
peerAddress
public abstract Address peerAddress()
-
isExpired
public abstract boolean isExpired(long millis)
-
connect
public abstract void connect(Address dest) throws java.lang.Exception
- Throws:
java.lang.Exception
-
start
public abstract void start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
send
public abstract void send(byte[] buf, int offset, int length) throws java.lang.Exception
- Throws:
java.lang.Exception
-
send
public abstract void send(java.nio.ByteBuffer buf) throws java.lang.Exception
- Throws:
java.lang.Exception
-
status
public abstract java.lang.String status()
-
-