|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_LoadBalancer
Interface to the load balancing implementation.
See http://www.ddj.com/documents/s=921/ddj9804i/9804i.htm
Method Summary | |
---|---|
NodeMasterInfo |
getClusterNode(java.util.Set nodeMasterInfoSet,
java.lang.String keyOidForLogging)
Your plugin should determine which xmlBlaster node to choose. |
void |
initialize(ServerScope glob,
ClusterManager clusterManager)
This is called after instantiation of the plugin |
Method Detail |
---|
void initialize(ServerScope glob, ClusterManager clusterManager)
glob
- The Global handle of this xmlBlaster server instance.clusterManager
- My managerNodeMasterInfo getClusterNode(java.util.Set nodeMasterInfoSet, java.lang.String keyOidForLogging) throws XmlBlasterException
Iterator it = clusterNodeSet.iterator(); while (it.hasNext()) { NodeMasterInfo nodeMasterInfo = (NodeMasterInfo)it.Next(); ... // Your load balancing code // Return the clusterNode if nodeMasterInfo is OK to handle the message: ClusterNode clusterNode = nodeMasterInfo.getClusterNode(); return clusterNode; }This corresponds to the following XML configuration:
<!-- NodeMasterInfo.java contains the parsed: --> <master type='DomainToMaster' stratum='0'> <key domain='RUGBY'/> <key type='XPATH'>//STOCK</key> </master>
nodeMasterInfoSet
- A set containing NodeMasterInfo objects, the possible xmlBlaster nodes.
Is never null, but may have a size of 0.
The set i guaranteed to be sorted after"available:stratum:nodeId" available := The connection state is: 0 connected, 1 polling stratum := 0 master, 1 slave, 2 slaveOfSlave ... nodeId := a unique counter (nodeMasterInfo.getCount())The set contains only nodes marked as allowed (these are nodes we are connected to or polling for), not available nodes are filtered away already.
keyOidForLogging
- A nice string for logging the context
nodeMasterInfo.getClusterNode()
and the xmlBlasterConnection
to the master node with nodeMasterInfo.getClusterNode().getXmlBlasterAccess()
XmlBlasterException
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |