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
protected BaseServer
server
-
Constructor Summary
Constructors Constructor Description Connection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
connect(Address dest)
abstract void
flush()
protected long
getTimestamp()
abstract boolean
isClosed()
abstract boolean
isConnected()
abstract boolean
isConnectionPending()
boolean
isExpired(long now)
abstract Address
localAddress()
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()
protected void
updateLastAccessed()
-
-
-
Field Detail
-
cookie
public static final byte[] cookie
-
server
protected BaseServer server
-
peer_addr
protected Address peer_addr
-
last_access
protected long last_access
-
-
Method Detail
-
isConnected
public abstract boolean isConnected()
-
isConnectionPending
public abstract boolean isConnectionPending()
-
isClosed
public abstract boolean isClosed()
-
localAddress
public abstract Address localAddress()
-
peerAddress
public Address peerAddress()
-
flush
public abstract void flush()
-
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()
-
getTimestamp
protected long getTimestamp()
-
updateLastAccessed
protected void updateLastAccessed()
-
isExpired
public boolean isExpired(long now)
-
-