public abstract class AbstractConnectionMap<V extends Connection> extends Object implements ConnectionMap<V>
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractConnectionMap.ConnectionMapListener<V> |
Modifier and Type | Field and Description |
---|---|
protected List<AbstractConnectionMap.ConnectionMapListener<V>> |
conn_listeners |
protected Map<Address,V> |
conns |
protected ThreadFactory |
factory |
protected Lock |
lock |
protected org.jgroups.blocks.AbstractConnectionMap.Reaper |
reaper |
protected long |
reaperInterval |
protected Lock |
sock_creation_lock |
Constructor and Description |
---|
AbstractConnectionMap(ThreadFactory factory) |
AbstractConnectionMap(ThreadFactory factory,
long reaperInterval) |
Modifier and Type | Method and Description |
---|---|
void |
addConnection(Address address,
V conn) |
void |
addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml) |
protected void |
clear() |
Lock |
getLock() |
int |
getNumConnections() |
int |
getNumOpenConnections() |
ThreadFactory |
getThreadFactory() |
boolean |
hasConnection(Address address) |
protected void |
notifyConnectionClosed(Address address) |
protected void |
notifyConnectionOpened(Address address,
V conn) |
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(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 List<AbstractConnectionMap.ConnectionMapListener<V extends Connection>> conn_listeners
protected final Map<Address,V extends Connection> conns
protected final Lock lock
protected final Lock sock_creation_lock
protected final ThreadFactory factory
protected final long reaperInterval
protected final org.jgroups.blocks.AbstractConnectionMap.Reaper reaper
public AbstractConnectionMap(ThreadFactory factory)
public AbstractConnectionMap(ThreadFactory factory, long reaperInterval)
public Lock getLock()
public boolean hasConnection(Address address)
public void addConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
public int getNumConnections()
public int getNumOpenConnections()
public String printConnections()
public ThreadFactory getThreadFactory()
public void removeConnectionIfPresent(Address address, V conn)
public void removeConnectionMapListener(AbstractConnectionMap.ConnectionMapListener<V> cml)
public void retainAll(Collection<Address> current_mbrs)
current_mbrs
- public void stop()
protected void clear()
protected void notifyConnectionClosed(Address address)
Copyright © 2015 JBoss, a division of Red Hat. All rights reserved.