Author: ruwan Date: Wed Apr 22 00:18:51 2009 New Revision: 33876 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=33876
Log: Fixing the clustering API Modified: branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2LoadBalanceMembershipHandler.java branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CacheMediator.java branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/util/Replicator.java branches/synapse/1.3-wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java branches/synapse/1.3-wso2v1/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java branches/synapse/1.3-wso2v1/pom.xml Modified: branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2LoadBalanceMembershipHandler.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2LoadBalanceMembershipHandler.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2LoadBalanceMembershipHandler.java (original) +++ branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2LoadBalanceMembershipHandler.java Wed Apr 22 00:18:51 2009 @@ -18,9 +18,9 @@ */ package org.apache.synapse.core.axis2; -import org.apache.axis2.clustering.ClusterManager; -import org.apache.axis2.clustering.LoadBalanceEventHandler; +import org.apache.axis2.clustering.ClusteringAgent; import org.apache.axis2.clustering.Member; +import org.apache.axis2.clustering.management.GroupManagementAgent; import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -38,7 +38,7 @@ private static final Log log = LogFactory.getLog(Axis2LoadBalanceMembershipHandler.class); private String lbDomain; - private LoadBalanceEventHandler lbEventHandler; + private GroupManagementAgent groupMgtAgent; private ConfigurationContext configCtx; private LoadbalanceAlgorithm algorithm; @@ -59,15 +59,15 @@ this.configCtx = configCtx; // The following code does the bridging between Axis2 and Synapse load balancing - ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager(); - if(clusterManager == null){ + ClusteringAgent clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent(); + if(clusteringAgent == null){ String msg = "In order to enable load balancing across an Axis2 cluster, " + "the cluster entry should be enabled in the axis2.xml file"; log.error(msg); throw new SynapseException(msg); } - lbEventHandler = clusterManager.getLoadBalanceEventHandler(lbDomain); - if(lbEventHandler == null){ + groupMgtAgent = clusteringAgent.getGroupManagementAgent(lbDomain); + if(groupMgtAgent == null){ String msg = "A LoadBalanceEventHandler has not been specified in the axis2.xml " + "file for the domain " + lbDomain; @@ -87,7 +87,7 @@ * @return The current member */ public Member getNextApplicationMember(AlgorithmContext context) { - algorithm.setApplicationMembers(lbEventHandler.getMembers()); + algorithm.setApplicationMembers(groupMgtAgent.getMembers()); return algorithm.getNextApplicationMember(context); } } Modified: branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java (original) +++ branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/endpoints/AbstractEndpoint.java Wed Apr 22 00:18:51 2009 @@ -19,7 +19,7 @@ package org.apache.synapse.endpoints; -import org.apache.axis2.clustering.ClusterManager; +import org.apache.axis2.clustering.ClusteringAgent; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.transport.base.BaseConstants; import org.apache.commons.logging.Log; @@ -134,8 +134,8 @@ ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext(); if (!initialized) { // The check for clustering environment - ClusterManager clusterManager = cc.getAxisConfiguration().getClusterManager(); - if (clusterManager != null && clusterManager.getContextManager() != null) { + ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent(); + if (clusteringAgent != null && clusteringAgent.getStateManager() != null) { isClusteringEnabled = Boolean.TRUE; } else { isClusteringEnabled = Boolean.FALSE; Modified: branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CacheMediator.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CacheMediator.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CacheMediator.java (original) +++ branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/mediators/builtin/CacheMediator.java Wed Apr 22 00:18:51 2009 @@ -21,7 +21,7 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.clustering.ClusteringFault; -import org.apache.axis2.clustering.context.Replicator; +import org.apache.axis2.clustering.state.Replicator; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.saaj.util.SAAJUtil; import org.apache.synapse.ManagedLifecycle; Modified: branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/util/Replicator.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/util/Replicator.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/util/Replicator.java (original) +++ branches/synapse/1.3-wso2v1/modules/core/src/main/java/org/apache/synapse/util/Replicator.java Wed Apr 22 00:18:51 2009 @@ -49,7 +49,7 @@ } configCtx.removePropertyNonReplicable(key); - org.apache.axis2.clustering.context.Replicator.replicate( + org.apache.axis2.clustering.state.Replicator.replicate( configCtx, new String[]{key}); if (log.isDebugEnabled()) { @@ -81,7 +81,7 @@ } configCtx.setNonReplicableProperty(key, value); - org.apache.axis2.clustering.context.Replicator.replicate( + org.apache.axis2.clustering.state.Replicator.replicate( configCtx, new String[]{key}); if (log.isDebugEnabled()) { Modified: branches/synapse/1.3-wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java (original) +++ branches/synapse/1.3-wso2v1/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java Wed Apr 22 00:18:51 2009 @@ -30,9 +30,9 @@ import org.apache.synapse.core.axis2.Axis2MessageContext; import org.apache.synapse.mediators.AbstractMediator; import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.clustering.context.Replicator; +import org.apache.axis2.clustering.state.Replicator; import org.apache.axis2.clustering.ClusteringFault; -import org.apache.axis2.clustering.ClusterManager; +import org.apache.axis2.clustering.ClusteringAgent; import org.wso2.throttle.*; @@ -120,9 +120,9 @@ //To ensure check for clustering environment only happens one time if ((throttle == null && !isResponse) || (isResponse && concurrentAccessController == null)) { - ClusterManager clusterManager = cc.getAxisConfiguration().getClusterManager(); - if (clusterManager != null && - clusterManager.getContextManager() != null) { + ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent(); + if (clusteringAgent != null && + clusteringAgent.getStateManager() != null) { isClusteringEnable = true; } } Modified: branches/synapse/1.3-wso2v1/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java (original) +++ branches/synapse/1.3-wso2v1/modules/samples/src/main/java/samples/util/SampleAxis2ServerManager.java Wed Apr 22 00:18:51 2009 @@ -25,7 +25,7 @@ import org.apache.axis2.util.CommandLineOption; import org.apache.axis2.util.CommandLineOptionParser; import org.apache.axis2.util.OptionsValidator; -//import org.apache.axis2.clustering.ClusteringAgent; +import org.apache.axis2.clustering.ClusteringAgent; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -98,12 +98,12 @@ // Need to initialize the cluster manager at last since we are changing the servers // HTTP/S ports above. In the axis2.xml file, we need to set the "AvoidInitiation" param // to "true" - /*ClusteringAgent clusteringAgent = + ClusteringAgent clusteringAgent = configctx.getAxisConfiguration().getClusteringAgent(); if(clusteringAgent != null) { clusteringAgent.setConfigurationContext(configctx); clusteringAgent.init(); - }*/ + } // Finally start the transport listeners listenerManager = new ListenerManager(); Modified: branches/synapse/1.3-wso2v1/pom.xml URL: http://wso2.org/svn/browse/wso2/branches/synapse/1.3-wso2v1/pom.xml?rev=33876&r1=33875&r2=33876&view=diff ============================================================================== --- branches/synapse/1.3-wso2v1/pom.xml (original) +++ branches/synapse/1.3-wso2v1/pom.xml Wed Apr 22 00:18:51 2009 @@ -826,7 +826,7 @@ <jms-1.1-spec.version>1.1</jms-1.1-spec.version> <!-- Axis2 1.4 and its dependencies --> - <axis2.version>1.5-SNAPSHOT</axis2.version> + <axis2.version>SNAPSHOT</axis2.version> <axis2.transport.version>1.0-SNAPSHOT</axis2.transport.version> <axiom.version>1.2.8</axiom.version> <xml_schema.version>1.4.3</xml_schema.version> @@ -836,7 +836,7 @@ <commons.logging.version>1.1.1</commons.logging.version> <!-- addressing, rampart, neethi --> - <addressing.version>1.5-SNAPSHOT</addressing.version> + <addressing.version>SNAPSHOT</addressing.version> <rampart.version>SNAPSHOT</rampart.version> <sandesha2.version>SNAPSHOT</sandesha2.version> <neethi.version>2.0.4</neethi.version> _______________________________________________ Esb-java-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
