Package org.jgroups.stack
Class RouterStubManager
java.lang.Object
org.jgroups.stack.RouterStubManager
- All Implemented Interfaces:
Runnable,RouterStub.CloseListener
Manages a list of RouterStubs (e.g. health checking, reconnecting).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Runnableprotected final Stringprotected longprotected Future<?> protected longprotected final Addressprotected final Logprotected final Stringprotected intprotected booleanprotected final PhysicalAddressprotected final longprotected Future<?> protected final Runnableprotected SocketFactoryprotected final List<RouterStub> protected Future<?> protected final TimeSchedulerprotected boolean -
Constructor Summary
ConstructorsConstructorDescriptionRouterStubManager(Log log, TimeScheduler timer, String cluster_name, Address local_addr, String logical_name, PhysicalAddress phys_addr, long reconnect_interval) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclosed(RouterStub stub) intvoidcreateAndRegisterStub(InetSocketAddress local, InetSocketAddress router_addr) createAndRegisterStub(InetSocketAddress local, InetSocketAddress router_addr, int linger) voidbooleanvoidstatic RouterStubManageremptyGossipClientStubManager(Log log, TimeScheduler timer) protected RouterStubvoidforAny(Consumer<RouterStub> action) Applies action to a randomly picked RouterStub that's connectedvoidforEach(Consumer<RouterStub> action) Applies action to all connected RouterStubsheartbeat(long heartbeat_interval, long heartbeat_timeout) booleanintmaxSendQueue(int s) booleannonBlockingSends(boolean b) print()booleanvoidrun()protected voidsocketFactory(SocketFactory socket_factory) protected voidprotected voidprotected voidprotected voidprotected voidprotected voidbooleanunregisterStub(InetSocketAddress router_addr_sa) useNio(boolean flag)
-
Field Details
-
stubs
-
timer
-
cluster_name
-
local_addr
-
logical_name
-
phys_addr
-
reconnect_interval
protected final long reconnect_interval -
use_nio
protected boolean use_nio -
reconnector_task
-
heartbeat_task
-
timeout_checker_task
-
log
-
socket_factory
-
heartbeat_interval
protected long heartbeat_interval -
heartbeat_timeout
protected long heartbeat_timeout -
send_heartbeat
-
check_timeouts
-
non_blocking_sends
protected boolean non_blocking_sends -
max_send_queue
protected int max_send_queue
-
-
Constructor Details
-
RouterStubManager
public RouterStubManager(Log log, TimeScheduler timer, String cluster_name, Address local_addr, String logical_name, PhysicalAddress phys_addr, long reconnect_interval)
-
-
Method Details
-
emptyGossipClientStubManager
-
useNio
-
reconnectorRunning
public boolean reconnectorRunning() -
heartbeaterRunning
public boolean heartbeaterRunning() -
timeouterRunning
public boolean timeouterRunning() -
nonBlockingSends
public boolean nonBlockingSends() -
nonBlockingSends
-
maxSendQueue
public int maxSendQueue() -
maxSendQueue
-
socketFactory
-
heartbeat
-
forEach
Applies action to all connected RouterStubs -
forAny
Applies action to a randomly picked RouterStub that's connected- Parameters:
action-
-
createAndRegisterStub
-
createAndRegisterStub
public RouterStub createAndRegisterStub(InetSocketAddress local, InetSocketAddress router_addr, int linger) -
unregisterStub
-
connectStubs
public void connectStubs() -
disconnectStubs
public void disconnectStubs() -
destroyStubs
public void destroyStubs() -
printStubs
-
printReconnectList
-
print
-
run
public void run() -
closed
- Specified by:
closedin interfaceRouterStub.CloseListener
-
startReconnector
protected void startReconnector() -
stopReconnector
protected void stopReconnector() -
startHeartbeatTask
protected void startHeartbeatTask() -
stopHeartbeatTask
protected void stopHeartbeatTask() -
startTimeoutChecker
protected void startTimeoutChecker() -
stopTimeoutChecker
protected void stopTimeoutChecker() -
findRandomConnectedStub
-
sendHeartbeat
protected void sendHeartbeat() -
checkTimeouts
protected void checkTimeouts() -
connectedStubs
public int connectedStubs() -
disconnectedStubs
public boolean disconnectedStubs()
-