public abstract class AbstractConnectionMap<V extends Connection> extends java.lang.Object implements ConnectionMap<V>
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractConnectionMap.ConnectionMapListener<V> |
Modifier and Type | Field and Description |
---|---|
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 org.jgroups.blocks.AbstractConnectionMap.Reaper |
reaper |
protected long |
reaperInterval |
protected java.util.concurrent.locks.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() |
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 org.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)
Copyright © 1998-2020 Red Hat. All Rights Reserved.