public abstract class BasicConnectionTable
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BasicConnectionTable.ConnectionListener
Used to be notified about connection establishment and teardown.
|
static interface |
BasicConnectionTable.Receiver
Used for message reception.
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log |
protected PortsManager |
pm |
Modifier | Constructor and Description |
---|---|
protected |
BasicConnectionTable() |
Modifier and Type | Method and Description |
---|---|
void |
addConnectionListener(BasicConnectionTable.ConnectionListener l) |
int |
getLinger() |
Address |
getLocalAddress() |
static int |
getNumberOfConnectionCreations() |
int |
getNumConnections() |
int |
getPeerAddressReadTimeout() |
int |
getReceiveBufferSize() |
int |
getSendBufferSize() |
int |
getSendQueueSize() |
int |
getSocketConnectionTimeout() |
boolean |
getTcpNodelay() |
ThreadFactory |
getThreadFactory() |
boolean |
getUseSendQueues() |
void |
receive(Address sender,
byte[] data,
int offset,
int length)
Calls the receiver callback.
|
void |
removeConnection(Address addr)
Remove
addr from connection table. |
void |
removeConnectionListener(BasicConnectionTable.ConnectionListener l) |
void |
retainAll(java.util.Collection<Address> current_mbrs)
Removes all connections from ConnectionTable which are not in current_mbrs
|
void |
send(Address dest,
byte[] data,
int offset,
int length) |
void |
setLinger(int linger) |
void |
setPeerAddressReadTimeout(int peer_addr_read_timeout) |
void |
setReceiveBufferSize(int recv_buf_size) |
void |
setReceiver(BasicConnectionTable.Receiver r) |
void |
setSendBufferSize(int send_buf_size) |
void |
setSendQueueSize(int send_queue_size) |
void |
setSocketConnectionTimeout(int sock_conn_timeout) |
void |
setTcpNodelay(boolean tcp_nodelay) |
void |
setThreadFactory(ThreadFactory factory) |
void |
setUseSendQueues(boolean flag) |
void |
start() |
void |
stop() |
java.lang.String |
toString() |
protected final org.apache.commons.logging.Log log
protected PortsManager pm
public final void setReceiver(BasicConnectionTable.Receiver r)
public void addConnectionListener(BasicConnectionTable.ConnectionListener l)
public void removeConnectionListener(BasicConnectionTable.ConnectionListener l)
public Address getLocalAddress()
public int getSendBufferSize()
public void setSendBufferSize(int send_buf_size)
public int getReceiveBufferSize()
public void setReceiveBufferSize(int recv_buf_size)
public int getSocketConnectionTimeout()
public void setSocketConnectionTimeout(int sock_conn_timeout)
public int getPeerAddressReadTimeout()
public void setPeerAddressReadTimeout(int peer_addr_read_timeout)
public int getNumConnections()
public static int getNumberOfConnectionCreations()
public boolean getTcpNodelay()
public void setTcpNodelay(boolean tcp_nodelay)
public int getLinger()
public void setLinger(int linger)
public void setThreadFactory(ThreadFactory factory)
public ThreadFactory getThreadFactory()
public boolean getUseSendQueues()
public void setUseSendQueues(boolean flag)
public int getSendQueueSize()
public void setSendQueueSize(int send_queue_size)
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public void removeConnection(Address addr)
addr
from connection table. This is typically triggered when a member is suspected.public void receive(Address sender, byte[] data, int offset, int length)
public java.lang.String toString()
toString
in class java.lang.Object
public void send(Address dest, byte[] data, int offset, int length) throws java.lang.Exception
java.lang.Exception
public void retainAll(java.util.Collection<Address> current_mbrs)
current_mbrs
- Copyright ? 1998-2008 Bela Ban. All Rights Reserved.