public interface ClusteringAgent extends ParameterInclude
This is the main interface in the Axis2 clustering implementation. In order to plug-in a new clustering implementation, this interface has to be implemented.
The initilization of a node in the cluster is handled here. It is also responsible for getting
this node to join the cluster. This node should not process any Web services requests until it
successfully joins the cluster. Generally, this node will also need to obtain the state
information and/or configuration information from a neighboring node.
This interface is also responsible for
properly instantiating a StateManager
&
NodeManager
. In the case of
a static
membership scheme,
this members are read from the axis2.xml file and added to the ClusteringAgent.
In the axis2.xml, the instance of this interface is specified using the "clustering"
class attribute.
e.g.
specifies that the TribesClusterAgent class is the instance of this interface that
needs to be used.
There can also be several "parameter" elements, which are children of the "clustering" element in the axis2.xml file. Generally, these parameters will be specific to the ClusteringAgent implementation.
Modifier and Type | Method and Description |
---|---|
void |
addGroupManagementAgent(GroupManagementAgent agent,
String applicationDomain)
Set the load balance event handler which will be notified when load balance events occur.
|
void |
finalize()
Do cleanup & leave the cluster
|
Set<String> |
getDomains()
Get all the domains that this ClusteringAgent belongs to
|
GroupManagementAgent |
getGroupManagementAgent(String applicationDomain)
Get the LoadBalanceEventHandler which corresponds to the
applicationDomain
This will be valid only when this node is running in loadBalance mode |
List<Member> |
getMembers()
Get the list of members in a
static group
|
NodeManager |
getNodeManager() |
StateManager |
getStateManager() |
void |
init()
Initialize this node, and join the cluster
|
void |
setConfigurationContext(ConfigurationContext configurationContext)
Set the system's configuration context.
|
void |
setMembers(List<Member> members)
Set the static members of the cluster.
|
void |
setNodeManager(NodeManager nodeManager)
Set the NodeManager corresponding to this ClusteringAgent.
|
void |
setStateManager(StateManager stateManager)
Set the StateManager corresponding to this ClusteringAgent.
|
void |
shutdown()
Disconnect this node from the cluster.
|
addParameter, deserializeParameters, getParameter, getParameters, isParameterLocked, removeParameter
void init() throws ClusteringFault
ClusteringFault
- If an error occurs while initializing this node or joining the clustervoid finalize()
StateManager getStateManager()
NodeManager getNodeManager()
void setStateManager(StateManager stateManager)
ClusterBuilder
, by
reading the "contextManager" element in the axis2.xml
e.g.
stateManager
- The StateManager instancevoid setNodeManager(NodeManager nodeManager)
ClusterBuilder
, by
reading the "configurationManager" element in the axis2.xml
e.g.
nodeManager
- The NodeManager instancevoid shutdown() throws ClusteringFault
ClusteringFault
- If an error occurs while leaving the clustervoid setConfigurationContext(ConfigurationContext configurationContext)
configurationContext
- The configuration contextvoid setMembers(List<Member> members)
members
- Members to be addedList<Member> getMembers()
void addGroupManagementAgent(GroupManagementAgent agent, String applicationDomain)
agent
- The load balance event handlerapplicationDomain
- The application domain which is handled by the eventHandlerGroupManagementAgent getGroupManagementAgent(String applicationDomain)
applicationDomain
This will be valid only when this node is running in loadBalance modeapplicationDomain
- The application domain to which the application nodes being
load balanced belong toapplicationDomain
Copyright © 2004–2013 The Apache Software Foundation. All rights reserved.