You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by az...@apache.org on 2008/05/19 10:22:42 UTC
svn commit: r657753 - in /webservices/axis2/trunk/java/modules:
clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
kernel/conf/axis2.xml
kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
Author: azeez
Date: Mon May 19 01:22:42 2008
New Revision: 657753
URL: http://svn.apache.org/viewvc?rev=657753&view=rev
Log:
Added "enable" attribute for enabling/diabling context replication & config mgt
Modified:
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java?rev=657753&r1=657752&r2=657753&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java (original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java Mon May 19 01:22:42 2008
@@ -254,7 +254,7 @@
handlerDesc.setRules(rule);
phase.addHandler(requestBlockingHandler);
- log.info("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
+ log.debug("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
" between SOAPMessageBodyBasedDispatcher & InstanceDispatcher to InFlow");
break;
}
@@ -274,7 +274,7 @@
handlerDesc.setRules(rule);
phase.addHandler(requestBlockingHandler);
- log.info("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
+ log.debug("Added " + ClusteringConstants.REQUEST_BLOCKING_HANDLER +
" between SOAPMessageBodyBasedDispatcher & InstanceDispatcher to InFaultFlow");
break;
}
Modified: webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?rev=657753&r1=657752&r2=657753&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Mon May 19 01:22:42 2008
@@ -340,8 +340,11 @@
Axis2 configuration in a consistent manner
2. Deploying a new service to a cluster or undeploying a service from a cluster
3. Changing the policies of a service deployed on the cluster
+
+ The "enable" attribute indicates whether Configuration management has been enabled
-->
- <configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
+ <configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager"
+ enable="true">
<listener class="org.apache.axis2.cluster.configuration.DefaultConfigurationManagerListener"/>
</configurationManager>
@@ -352,8 +355,11 @@
The "excludes" patterns can be used to specify the prefixes (e.g. local_*) or
suffixes (e.g. *_local) of the properties to be excluded from replication. The pattern
"*" indicates that all properties in a particular context should not be replicated.
+
+ The "enable" attribute indicates whether context replication has been enabled
-->
- <contextManager class="org.apache.axis2.clustering.context.DefaultContextManager">
+ <contextManager class="org.apache.axis2.clustering.context.DefaultContextManager"
+ enable="true">
<listener class="org.apache.axis2.clustering.context.DefaultContextManagerListener"/>
<replication>
<defaults>
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java?rev=657753&r1=657752&r2=657753&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java Mon May 19 01:22:42 2008
@@ -32,6 +32,8 @@
import org.apache.axis2.description.Parameter;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.i18n.Messages;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import javax.xml.namespace.QName;
import java.util.ArrayList;
@@ -44,6 +46,8 @@
*/
public class ClusterBuilder extends DescriptionBuilder {
+ private static final Log log = LogFactory.getLog(ClusterBuilder.class);
+
public ClusterBuilder(AxisConfiguration axisConfig) {
this.axisConfig = axisConfig;
}
@@ -56,12 +60,11 @@
*/
public void buildCluster(OMElement clusterElement) throws DeploymentException {
- OMAttribute enableAttr = clusterElement.getAttribute(new QName("enable"));
- if(enableAttr != null){
- if(!Boolean.parseBoolean(enableAttr.getAttributeValue().trim())){
- return;
- }
+ if (!isEnabled(clusterElement)) {
+ log.info("Clustering has been disabled");
+ return;
}
+ log.info("Clustering has been enabled");
OMAttribute classNameAttr = clusterElement.getAttribute(new QName(TAG_CLASS_NAME));
if (classNameAttr == null) {
@@ -105,6 +108,15 @@
}
}
+ private boolean isEnabled(OMElement element) {
+ boolean enabled = true;
+ OMAttribute enableAttr = element.getAttribute(new QName("enable"));
+ if (enableAttr != null) {
+ enabled = Boolean.parseBoolean(enableAttr.getAttributeValue().trim());
+ }
+ return enabled;
+ }
+
private void loadMembers(ClusterManager clusterManager, OMElement clusterElement) {
clusterManager.setMembers(new Member[0]);
Parameter membershipSchemeParam = clusterManager.getParameter("membershipScheme");
@@ -137,6 +149,11 @@
OMElement contextManagerEle =
clusterElement.getFirstChildWithName(new QName(TAG_CONTEXT_MANAGER));
if (contextManagerEle != null) {
+ if (!isEnabled(contextManagerEle)) {
+ log.info("Clustering context management has been disabled");
+ return;
+ }
+ log.info("Clustering context management has been enabled");
// Load & set the ContextManager class
OMAttribute classNameAttr =
@@ -243,6 +260,12 @@
OMElement configManagerEle =
clusterElement.getFirstChildWithName(new QName(TAG_CONFIGURATION_MANAGER));
if (configManagerEle != null) {
+ if (!isEnabled(configManagerEle)) {
+ log.info("Clustering configuration management has been disabled");
+ return;
+ }
+ log.info("Clustering configuration management has been enabled");
+
OMAttribute classNameAttr = configManagerEle.getAttribute(new QName(ATTRIBUTE_CLASS));
if (classNameAttr == null) {
throw new DeploymentException(Messages.getMessage("classAttributeNotFound",