public class RouterStubManager extends java.lang.Object implements java.lang.Runnable, RouterStub.CloseListener
Modifier and Type | Class and Description |
---|---|
static interface |
RouterStubManager.Consumer
Interface to iterate through stubs.
|
protected static class |
RouterStubManager.Target |
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
cluster_name |
protected java.util.concurrent.ConcurrentMap<RouterStub,java.util.concurrent.Future<?>> |
futures |
protected long |
interval |
protected Address |
local_addr |
protected Log |
log |
protected java.lang.String |
logical_name |
protected Protocol |
owner |
protected PhysicalAddress |
phys_addr |
protected java.util.Set<RouterStubManager.Target> |
reconnect_list |
protected java.util.concurrent.Future<?> |
reconnector_task |
protected java.util.List<RouterStub> |
stubs |
protected TimeScheduler |
timer |
protected boolean |
use_nio |
Constructor and Description |
---|
RouterStubManager(Protocol owner,
java.lang.String cluster_name,
Address local_addr,
java.lang.String logical_name,
PhysicalAddress phys_addr,
long interval) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
add(RouterStub stub) |
protected boolean |
add(RouterStubManager.Target target) |
protected void |
apply(RouterStub stub,
RouterStubManager.Consumer action) |
void |
closed(RouterStub stub) |
void |
connectStubs() |
RouterStub |
createAndRegisterStub(IpAddress local,
IpAddress router_addr) |
void |
destroyStubs() |
void |
disconnectStubs() |
static RouterStubManager |
emptyGossipClientStubManager(Protocol p) |
protected RouterStub |
find(IpAddress router_addr) |
void |
forAny(RouterStubManager.Consumer action)
Applies action to a randomly picked RouterStub that's connected
|
void |
forEach(RouterStubManager.Consumer action)
Applies action to all RouterStubs that are connected
|
protected void |
moveStubToReconnects(RouterStub stub) |
java.lang.String |
print() |
java.lang.String |
printReconnectList() |
java.lang.String |
printStubs() |
protected boolean |
reconnect(RouterStubManager.Target target) |
protected boolean |
remove(RouterStub stub) |
protected boolean |
remove(RouterStubManager.Target target) |
void |
run() |
protected void |
startReconnector() |
protected void |
stopReconnector() |
RouterStub |
unregisterStub(IpAddress router_addr) |
RouterStubManager |
useNio(boolean flag) |
protected final java.util.concurrent.ConcurrentMap<RouterStub,java.util.concurrent.Future<?>> futures
protected volatile java.util.List<RouterStub> stubs
protected volatile java.util.Set<RouterStubManager.Target> reconnect_list
protected final Protocol owner
protected final TimeScheduler timer
protected final java.lang.String cluster_name
protected final Address local_addr
protected final java.lang.String logical_name
protected final PhysicalAddress phys_addr
protected final long interval
protected boolean use_nio
protected java.util.concurrent.Future<?> reconnector_task
protected final Log log
public RouterStubManager(Protocol owner, java.lang.String cluster_name, Address local_addr, java.lang.String logical_name, PhysicalAddress phys_addr, long interval)
public static RouterStubManager emptyGossipClientStubManager(Protocol p)
public RouterStubManager useNio(boolean flag)
public void forEach(RouterStubManager.Consumer action)
action
- public void forAny(RouterStubManager.Consumer action)
action
- public RouterStub createAndRegisterStub(IpAddress local, IpAddress router_addr)
public RouterStub unregisterStub(IpAddress router_addr)
public void connectStubs()
public void disconnectStubs()
public void destroyStubs()
public java.lang.String printStubs()
public java.lang.String printReconnectList()
public java.lang.String print()
public void run()
run
in interface java.lang.Runnable
public void closed(RouterStub stub)
closed
in interface RouterStub.CloseListener
protected boolean reconnect(RouterStubManager.Target target)
protected void moveStubToReconnects(RouterStub stub)
protected boolean add(RouterStub stub)
protected boolean add(RouterStubManager.Target target)
protected boolean remove(RouterStub stub)
protected boolean remove(RouterStubManager.Target target)
protected void apply(RouterStub stub, RouterStubManager.Consumer action)
protected RouterStub find(IpAddress router_addr)
protected void startReconnector()
protected void stopReconnector()
Copyright © 1998-2020 Red Hat. All Rights Reserved.