org.jgroups.blocks
Class AbstractConnectionMap<V extends Connection>

java.lang.Object
  extended by org.jgroups.blocks.AbstractConnectionMap<V>
All Implemented Interfaces:
ConnectionMap<V>
Direct Known Subclasses:
TCPConnectionMap.Mapper

public abstract class AbstractConnectionMap<V extends Connection>
extends java.lang.Object
implements ConnectionMap<V>


Nested Class Summary
static interface AbstractConnectionMap.ConnectionMapListener<V>
           
 
Field Summary
protected  java.util.List<AbstractConnectionMap.ConnectionMapListener<V>> conn_listeners
           
protected  java.util.Map<Address,V> conns
           
protected  ThreadFactory factory
           
protected  java.util.concurrent.locks.Lock lock
           
protected  Log log
           
protected  org.jgroups.blocks.AbstractConnectionMap.Reaper reaper
           
protected  long reaperInterval
           
protected  java.util.concurrent.locks.Lock sock_creation_lock
           
 
Constructor Summary
AbstractConnectionMap(ThreadFactory factory)
           
AbstractConnectionMap(ThreadFactory factory, long reaperInterval)
           
 
Method Summary
 void addConnection(Address address, V conn)
           
 void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
           
protected  void clear()
           
 java.util.concurrent.locks.Lock getLock()
           
 int getNumConnections()
           
 ThreadFactory getThreadFactory()
           
 boolean hasConnection(Address address)
           
 boolean hasOpenConnection(Address address)
           
protected  void notifyConnectionClosed(Address address)
           
protected  void notifyConnectionOpened(Address address, V conn)
           
 java.lang.String printConnections()
           
 void removeConnection(Address address)
           
 void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
           
 void retainAll(java.util.Collection<Address> current_mbrs)
          Removes all connections which are not in current_mbrs
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jgroups.blocks.ConnectionMap
getConnection
 

Field Detail

conn_listeners

protected final java.util.List<AbstractConnectionMap.ConnectionMapListener<V extends Connection>> conn_listeners

conns

protected final java.util.Map<Address,V extends Connection> conns

lock

protected final java.util.concurrent.locks.Lock lock

sock_creation_lock

protected final java.util.concurrent.locks.Lock sock_creation_lock

factory

protected final ThreadFactory factory

reaperInterval

protected final long reaperInterval

reaper

protected final org.jgroups.blocks.AbstractConnectionMap.Reaper reaper

log

protected final Log log
Constructor Detail

AbstractConnectionMap

public AbstractConnectionMap(ThreadFactory factory)

AbstractConnectionMap

public AbstractConnectionMap(ThreadFactory factory,
                             long reaperInterval)
Method Detail

getLock

public java.util.concurrent.locks.Lock getLock()

hasOpenConnection

public boolean hasOpenConnection(Address address)

hasConnection

public boolean hasConnection(Address address)

addConnection

public void addConnection(Address address,
                          V conn)

addConnectionMapListener

public void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)

getNumConnections

public int getNumConnections()

printConnections

public java.lang.String printConnections()

getThreadFactory

public ThreadFactory getThreadFactory()

removeConnection

public void removeConnection(Address address)

removeConnectionMapListener

public void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)

retainAll

public void retainAll(java.util.Collection<Address> current_mbrs)
Removes all connections which are not in current_mbrs

Parameters:
current_mbrs -

start

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

stop

public void stop()

clear

protected void clear()

notifyConnectionClosed

protected void notifyConnectionClosed(Address address)

notifyConnectionOpened

protected void notifyConnectionOpened(Address address,
                                      V conn)


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.