public abstract class AbstractConnectionMap<V extends Connection> extends java.lang.Object implements ConnectionMap<V>
限定符和类型 | 类和说明 |
---|---|
static interface |
AbstractConnectionMap.ConnectionMapListener<V> |
限定符和类型 | 字段和说明 |
---|---|
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 com.fr.third.jgroups.blocks.AbstractConnectionMap.Reaper |
reaper |
protected long |
reaperInterval |
protected java.util.concurrent.locks.Lock |
sock_creation_lock |
构造器和说明 |
---|
AbstractConnectionMap(ThreadFactory factory) |
AbstractConnectionMap(ThreadFactory factory,
long reaperInterval) |
限定符和类型 | 方法和说明 |
---|---|
void |
addConnection(Address address,
V conn) |
void |
addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml) |
protected void |
clear() |
java.util.concurrent.locks.Lock |
getLock() |
int |
getNumConnections() |
int |
getNumOpenConnections() |
ThreadFactory |
getThreadFactory() |
boolean |
hasConnection(Address address) |
protected void |
notifyConnectionClosed(Address address) |
protected void |
notifyConnectionOpened(Address address,
V conn) |
java.lang.String |
printConnections() |
void |
removeConnectionIfPresent(Address address,
V conn)
Only removes the connection if conns.get(address) == conn
|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConnection
protected final java.util.List<AbstractConnectionMap.ConnectionMapListener<V extends Connection>> conn_listeners
protected final java.util.Map<Address,V extends Connection> conns
protected final java.util.concurrent.locks.Lock lock
protected final java.util.concurrent.locks.Lock sock_creation_lock
protected final ThreadFactory factory
protected final long reaperInterval
protected final com.fr.third.jgroups.blocks.AbstractConnectionMap.Reaper reaper
public AbstractConnectionMap(ThreadFactory factory)
public AbstractConnectionMap(ThreadFactory factory, long reaperInterval)
public java.util.concurrent.locks.Lock getLock()
public boolean hasConnection(Address address)
public void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
public int getNumConnections()
public int getNumOpenConnections()
public java.lang.String printConnections()
public ThreadFactory getThreadFactory()
public void removeConnectionIfPresent(Address address, V conn)
public void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
public void retainAll(java.util.Collection<Address> current_mbrs)
current_mbrs
- public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
protected void clear()
protected void notifyConnectionClosed(Address address)