clazz = Class.forName(className);
} catch (ClassNotFoundException e) {
throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
className));
}
StateManager stateManager = (StateManager) clazz.newInstance();
clusteringAgent.setStateManager(stateManager);
//loading the parameters.
processParameters(contextManagerEle.getChildrenWithName(new QName(TAG_PARAMETER)),
stateManager,
null);
// Load the replication patterns to be excluded. We load the following structure.
/*<replication>
<defaults>
<exclude name="foo.bar.*"/>
</defaults>
<context class="org.apache.axis2.context.ConfigurationContext">
<exclude name="my.sandesha.*"/>
</context>
<context class="org.apache.axis2.context.ServiceGroupContext">
<exclude name="my.sandesha.*"/>
</context>
<context class="org.apache.axis2.context.ServiceContext">
<exclude name="my.sandesha.*"/>
</context>
</replication>*/
OMElement replicationEle =
contextManagerEle.getFirstChildWithName(new QName(TAG_REPLICATION));
if (replicationEle != null) {
// Process defaults
OMElement defaultsEle =
replicationEle.getFirstChildWithName(new QName(TAG_DEFAULTS));
if (defaultsEle != null) {
List<String> defaults = new ArrayList<String>();
for (Iterator iter = defaultsEle.getChildrenWithName(new QName(TAG_EXCLUDE));
iter.hasNext();) {
OMElement excludeEle = (OMElement) iter.next();
OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
defaults.add(nameAtt.getAttributeValue());
}
stateManager.setReplicationExcludePatterns(TAG_DEFAULTS, defaults);
}
// Process specifics
for (Iterator iter = replicationEle.getChildrenWithName(new QName(TAG_CONTEXT));
iter.hasNext();) {
OMElement contextEle = (OMElement) iter.next();
String ctxClassName =
contextEle.getAttribute(new QName(ATTRIBUTE_CLASS)).getAttributeValue();
List<String> excludes = new ArrayList<String>();
for (Iterator iter2 = contextEle.getChildrenWithName(new QName(TAG_EXCLUDE));
iter2.hasNext();) {
OMElement excludeEle = (OMElement) iter2.next();
OMAttribute nameAtt = excludeEle.getAttribute(new QName(ATTRIBUTE_NAME));
excludes.add(nameAtt.getAttributeValue());
}
stateManager.setReplicationExcludePatterns(ctxClassName, excludes);
}
}
}
}