if (classNameAttr==null) {
throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CLUSTER));
}
String className = classNameAttr.getAttributeValue();
ClusterManager clusterManager;
try {
Class clazz = Class.forName(className);
clusterManager = (ClusterManager) clazz.newInstance();
//loading the parameters.
Iterator params = clusterElement.getChildrenWithName(new QName(TAG_PARAMETER));
processParameters(params, clusterManager,null );
//loading the ConfigurationManager
OMElement configurationManagerElement = clusterElement.getFirstChildWithName(
new QName (TAG_CONFIGURATION_MANAGER));
if (configurationManagerElement != null) {
classNameAttr = configurationManagerElement.getAttribute(new QName(TAG_CLASS_NAME));
if (classNameAttr==null) {
throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CONFIGURATION_MANAGER));
}
className = classNameAttr.getAttributeValue();
clazz = Class.forName(className);
ConfigurationManager configurationManager = (ConfigurationManager) clazz
.newInstance();
clusterManager.setConfigurationManager(configurationManager);
OMElement listenersElement = configurationManagerElement
.getFirstChildWithName(new QName(TAG_LISTENERS));
if (listenersElement != null) {
Iterator listenerElemIter = listenersElement.getChildrenWithName(new QName(
TAG_LISTENER));
while (listenerElemIter.hasNext()) {
OMElement listenerElement = (OMElement) listenerElemIter.next();
classNameAttr = listenerElement.getAttribute(new QName(TAG_CLASS_NAME));
if (classNameAttr==null) {
throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_LISTENER));
}
className = classNameAttr.getAttributeValue();
clazz = Class.forName(className);
ConfigurationManagerListener listener = (ConfigurationManagerListener) clazz
.newInstance();
listener.setConfigurationContext(configCtx);
configurationManager.addConfigurationManagerListener(listener);
}
}
//updating the ConfigurationManager with the new ConfigurationContext
configurationManager.setConfigurationContext(configCtx);
}
// loading the ContextManager
OMElement contextManagerElement = clusterElement.getFirstChildWithName(
new QName (TAG_CONTEXT_MANAGER));
if (contextManagerElement != null) {
classNameAttr = contextManagerElement.getAttribute(new QName(TAG_CLASS_NAME));
if (classNameAttr==null) {
throw new DeploymentException(Messages.getMessage("classAttributeNotFound", TAG_CONTEXT_MANAGER));
}
className = classNameAttr.getAttributeValue();
clazz = Class.forName(className);
ContextManager contextManager = (ContextManager) clazz.newInstance();
clusterManager.setContextManager(contextManager);
OMElement listenersElement = contextManagerElement.getFirstChildWithName(new QName(
TAG_LISTENERS));
if (listenersElement != null) {
Iterator listenerElemIter = listenersElement.getChildrenWithName(new QName(