Package org.jgroups.protocols.relay
Interface SiteMasterPicker
-
public interface SiteMasterPicker
Allows an implementation to pick aSiteMaster
or aRoute
from a list (if multiple site masters are enabled). An implementation could for example always pick the same site master (or route) for messages from a given sender (sticky site master policy, see https://issues.jboss.org/browse/JGRP-2112). The default implementation picks a random site master for every message to be relayed, even if they have the same original sender. If only one site master is configured, thenpickSiteMaster(List,Address)
(List,Address)} orpickRoute(String,List,Address)
will never be called.- Since:
- 3.6.12, 4.0
- Author:
- Bela Ban
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Route
pickRoute(java.lang.String site, java.util.List<Route> routes, Address original_sender)
Picks a route to a given remote site from a list of routes.Address
pickSiteMaster(java.util.List<Address> site_masters, Address original_sender)
Needs to pick a member from a list of addresses of site masters
-
-
-
Method Detail
-
pickSiteMaster
Address pickSiteMaster(java.util.List<Address> site_masters, Address original_sender)
Needs to pick a member from a list of addresses of site masters- Parameters:
site_masters
- The list of site mastersoriginal_sender
- The address of the original member sending a message- Returns:
- The address of the site master (in the local cluster) to be used to forward the message to
-
pickRoute
Route pickRoute(java.lang.String site, java.util.List<Route> routes, Address original_sender)
Picks a route to a given remote site from a list of routes.- Parameters:
site
- The name of the target (remote) site. Added for informational purposes; may or may not be used as selection criterium.routes
- The list of routes. A route can be picked for example by using the address of the remote site master:Route.siteMaster()
original_sender
- The address of the original sender- Returns:
- A route
-
-