Package org.jgroups.protocols.relay
Class Relayer
- java.lang.Object
-
- org.jgroups.protocols.relay.Relayer
-
public class Relayer extends java.lang.ObjectMaintains bridges and routing table. Does the routing of outgoing messages and dispatches incoming messages to the right members. A Relayer cannot be reused once it is stopped, but a new Relayer instance must be created.- Since:
- 3.2
- Author:
- Bela Ban
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classRelayer.Bridge
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Queue<Relayer.Bridge>bridgesThe bridges which are used to connect to different sitesprotected booleandoneFlag set when stop() is called.protected Loglogprotected RELAY2relayprotected java.util.concurrent.ConcurrentMap<java.lang.String,java.util.List<Route>>routesThe routing table.protected booleanstats
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandone()protected ViewgetBridgeView(java.lang.String cluster_name)protected RoutegetRoute(java.lang.String site)protected RoutegetRoute(java.lang.String site, Address sender)protected java.util.List<Route>getRoutes(java.lang.String... excluded_sites)protected java.util.List<java.lang.String>getSiteNames()protected static booleanisExcluded(Route route, java.lang.String... excluded_sites)java.lang.StringprintRoutes()voidstart(java.util.List<RelayConfig.BridgeConfig> bridge_configs, java.lang.String bridge_name, java.lang.String my_site_id)Creates all bridges from site_config and connects them (joining the bridge clusters)voidstop()Disconnects and destroys all bridges
-
-
-
Field Detail
-
routes
protected java.util.concurrent.ConcurrentMap<java.lang.String,java.util.List<Route>> routes
The routing table. Site IDs are the keys (e.g. "sfo", and list of routes are the values
-
bridges
protected final java.util.Queue<Relayer.Bridge> bridges
The bridges which are used to connect to different sites
-
log
protected final Log log
-
relay
protected final RELAY2 relay
-
done
protected volatile boolean done
Flag set when stop() is called. Since a Relayer should not be used after stop() has been called, a new instance needs to be created
-
stats
protected boolean stats
-
-
Method Detail
-
done
public boolean done()
-
start
public void start(java.util.List<RelayConfig.BridgeConfig> bridge_configs, java.lang.String bridge_name, java.lang.String my_site_id) throws java.lang.Throwable
Creates all bridges from site_config and connects them (joining the bridge clusters)- Parameters:
bridge_configs- A list of bridge configurationsbridge_name- The name of the local bridge channel, prefixed with '_'.my_site_id- The ID of this site- Throws:
java.lang.Throwable
-
stop
public void stop()
Disconnects and destroys all bridges
-
printRoutes
public java.lang.String printRoutes()
-
getRoute
protected Route getRoute(java.lang.String site)
-
getSiteNames
protected java.util.List<java.lang.String> getSiteNames()
-
getRoutes
protected java.util.List<Route> getRoutes(java.lang.String... excluded_sites)
-
getBridgeView
protected View getBridgeView(java.lang.String cluster_name)
-
isExcluded
protected static boolean isExcluded(Route route, java.lang.String... excluded_sites)
-
-