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/17 18:15:07 UTC

svn commit: r657385 - in /webservices/axis2/trunk/java/modules/kernel: conf/axis2.xml src/org/apache/axis2/deployment/ClusterBuilder.java

Author: azeez
Date: Sat May 17 09:15:06 2008
New Revision: 657385

URL: http://svn.apache.org/viewvc?rev=657385&view=rev
Log:
Added "enable" attribute to the cluster element. Now to enable clustering, we simply need to set the value of this attribute to "true". This change is backwards compatible i.e. old configurations 
where the cluster section does not have this attibute will continue to work.


Modified:
    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/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?rev=657385&r1=657384&r2=657385&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Sat May 17 09:15:06 2008
@@ -243,9 +243,11 @@
     <!-- ================================================= -->
     <!-- Clustering  -->
     <!-- ================================================= -->
-    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
     <!--
-    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
+     To enable clustering for this node, set the value of "enable" attribute of the "cluster"
+     element to "true"
+     -->
+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager" enable="false">
         <parameter name="membershipScheme">multicast</parameter>
         <parameter name="param1">value1</parameter>
         <parameter name="domain">apache.axis2.domain</parameter>
@@ -279,7 +281,6 @@
     	    <listener class="org.apache.axis2.cluster.context.DefaultContextManagerListener"/>
     	</contextManager>
     </cluster>
-    -->
 
     <!-- ================================================= -->
     <!-- Phases  -->

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=657385&r1=657384&r2=657385&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 Sat May 17 09:15:06 2008
@@ -23,8 +23,8 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.clustering.ClusterManager;
-import org.apache.axis2.clustering.Member;
 import org.apache.axis2.clustering.ClusteringConstants;
+import org.apache.axis2.clustering.Member;
 import org.apache.axis2.clustering.configuration.ConfigurationManager;
 import org.apache.axis2.clustering.configuration.ConfigurationManagerListener;
 import org.apache.axis2.clustering.context.ContextManager;
@@ -34,34 +34,35 @@
 import org.apache.axis2.i18n.Messages;
 
 import javax.xml.namespace.QName;
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 
 /**
- * Builds a service description from OM
+ * Builds the cluster configuration from the axis2.xml file
  */
 public class ClusterBuilder extends DescriptionBuilder {
 
-//	private static final Log log = LogFactory.getLog(ClusterBuilder.class);
-
     public ClusterBuilder(AxisConfiguration axisConfig) {
         this.axisConfig = axisConfig;
     }
 
-    public ClusterBuilder(InputStream serviceInputStream, AxisConfiguration axisConfig) {
-        super(serviceInputStream, axisConfig);
-    }
-
     /**
-     * Populates service from corresponding OM.
+     * Build the cluster configuration
      *
      * @param clusterElement Cluster element
+     * @throws DeploymentException If an error occurs while building the cluster configuration
      */
     public void buildCluster(OMElement clusterElement) throws DeploymentException {
 
+        OMAttribute enableAttr = clusterElement.getAttribute(new QName("enable"));
+        if(enableAttr != null){
+            if(!Boolean.parseBoolean(enableAttr.getAttributeValue().trim())){
+                return;
+            }
+        }
+
         OMAttribute classNameAttr = clusterElement.getAttribute(new QName(TAG_CLASS_NAME));
         if (classNameAttr == null) {
             throw new DeploymentException(Messages.getMessage("classAttributeNotFound",