org.jgroups.blocks
Class BasicConnectionTable

java.lang.Object
  extended by org.jgroups.blocks.BasicConnectionTable
Direct Known Subclasses:
ConnectionTable, ConnectionTableNIO

public abstract class BasicConnectionTable
extends java.lang.Object

Shared class for TCP connection tables.

Author:
Scott Marlow

Nested Class Summary
static interface BasicConnectionTable.ConnectionListener
          Used to be notified about connection establishment and teardown.
static interface BasicConnectionTable.Receiver
          Used for message reception.
 
Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
BasicConnectionTable()
           
 
Method Summary
 void addConnectionListener(BasicConnectionTable.ConnectionListener l)
           
 int getLinger()
           
 Address getLocalAddress()
           
 int getNumConnections()
           
 int getReceiveBufferSize()
           
 int getSendBufferSize()
           
 int getSocketConnectionTimeout()
           
 boolean getTcpNodelay()
           
 boolean getUseSendQueues()
           
 void receive(Address sender, byte[] data, int offset, int length)
          Calls the receiver callback.
 void remove(Address addr)
          Remove addrfrom connection table.
 void removeConnectionListener(BasicConnectionTable.ConnectionListener l)
           
 void retainAll(java.util.Collection 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 setReceiveBufferSize(int recv_buf_size)
           
 void setReceiver(BasicConnectionTable.Receiver r)
           
 void setSendBufferSize(int send_buf_size)
           
 void setSocketConnectionTimeout(int sock_conn_timeout)
           
 void setTcpNodelay(boolean tcp_nodelay)
           
 void setUseSendQueues(boolean flag)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

BasicConnectionTable

public BasicConnectionTable()
Method Detail

setReceiver

public final void setReceiver(BasicConnectionTable.Receiver r)

addConnectionListener

public void addConnectionListener(BasicConnectionTable.ConnectionListener l)

removeConnectionListener

public void removeConnectionListener(BasicConnectionTable.ConnectionListener l)

getLocalAddress

public Address getLocalAddress()

getSendBufferSize

public int getSendBufferSize()

setSendBufferSize

public void setSendBufferSize(int send_buf_size)

getReceiveBufferSize

public int getReceiveBufferSize()

setReceiveBufferSize

public void setReceiveBufferSize(int recv_buf_size)

getSocketConnectionTimeout

public int getSocketConnectionTimeout()

setSocketConnectionTimeout

public void setSocketConnectionTimeout(int sock_conn_timeout)

getNumConnections

public int getNumConnections()

getTcpNodelay

public boolean getTcpNodelay()

setTcpNodelay

public void setTcpNodelay(boolean tcp_nodelay)

getLinger

public int getLinger()

setLinger

public void setLinger(int linger)

getUseSendQueues

public boolean getUseSendQueues()

setUseSendQueues

public void setUseSendQueues(boolean flag)

start

public void start()
           throws java.lang.Exception
Throws:
java.lang.Exception

stop

public void stop()

remove

public void remove(Address addr)
Remove addrfrom connection table. This is typically triggered when a member is suspected.


receive

public void receive(Address sender,
                    byte[] data,
                    int offset,
                    int length)
Calls the receiver callback. We serialize access to this method because it may be called concurrently by several Connection handler threads. Therefore the receiver doesn't need to synchronize.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

send

public void send(Address dest,
                 byte[] data,
                 int offset,
                 int length)
          throws java.lang.Exception
Throws:
java.lang.Exception

retainAll

public void retainAll(java.util.Collection current_mbrs)
Removes all connections from ConnectionTable which are not in current_mbrs

Parameters:
current_mbrs -


Copyright ? 1998-2006 Bela Ban. All Rights Reserved.