You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by az...@apache.org on 2009/02/16 13:03:45 UTC

svn commit: r744900 [3/3] - in /webservices/axis2/trunk/java/modules: clustering/src/org/apache/axis2/clustering/ clustering/src/org/apache/axis2/clustering/configuration/ clustering/src/org/apache/axis2/clustering/context/ clustering/src/org/apache/ax...

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementAgent.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementAgent.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementAgent.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,74 @@
+/*                                                                             
+ * Copyright 2004,2005 The Apache Software Foundation.                         
+ *                                                                             
+ * Licensed under the Apache License, Version 2.0 (the "License");             
+ * you may not use this file except in compliance with the License.            
+ * You may obtain a copy of the License at                                     
+ *                                                                             
+ *      http://www.apache.org/licenses/LICENSE-2.0                             
+ *                                                                             
+ * Unless required by applicable law or agreed to in writing, software         
+ * distributed under the License is distributed on an "AS IS" BASIS,           
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
+ * See the License for the specific language governing permissions and         
+ * limitations under the License.                                              
+ */
+package org.apache.axis2.clustering.management;
+
+import org.apache.axis2.clustering.Member;
+import org.apache.axis2.clustering.ClusteringFault;
+
+import java.util.List;
+
+/**
+ * This is the interface through which the load balancing event are notified.
+ * This will only be used when this member is running in loadBalance mode. In order to do this,
+ * in the axis2.xml file, set the value of the "mode" parameter to "loadBalance" and then provide
+ * the class that implements this interface using the "loadBalanceEventHandler" entry.
+ */
+public interface GroupManagementAgent {
+
+    /**
+     * Set the  description about this group management agent
+     *
+     * @param description The description
+     */
+    void setDescription(String description);
+
+    /**
+     * Get the  description about this group management agent
+     *
+     * @return The description
+     */
+    String getDescription();
+
+    /**
+     * An application member joined the application group
+     *
+     * @param member Represents the member who joined
+     */
+    void applicationMemberAdded(Member member);
+
+    /**
+     * An application member left the application group
+     *
+     * @param member Represents the member who left
+     */
+    void applicationMemberRemoved(Member member);
+
+    /**
+     * Get the list of current members
+     *
+     * @return List of current members
+     */
+    List<Member> getMembers();
+
+
+    /**
+     * Send a GroupManagementCommand to the group
+     *
+     * @param command The command
+     * @throws ClusteringFault If an error occurs while sending the command
+     */
+    void send(GroupManagementCommand command) throws ClusteringFault;
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementCommand.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementCommand.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/GroupManagementCommand.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,24 @@
+/*                                                                             
+ * Copyright 2004,2005 The Apache Software Foundation.                         
+ *                                                                             
+ * Licensed under the Apache License, Version 2.0 (the "License");             
+ * you may not use this file except in compliance with the License.            
+ * You may obtain a copy of the License at                                     
+ *                                                                             
+ *      http://www.apache.org/licenses/LICENSE-2.0                             
+ *                                                                             
+ * Unless required by applicable law or agreed to in writing, software         
+ * distributed under the License is distributed on an "AS IS" BASIS,           
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
+ * See the License for the specific language governing permissions and         
+ * limitations under the License.                                              
+ */
+package org.apache.axis2.clustering.management;
+
+import org.apache.axis2.clustering.ClusteringCommand;
+
+/**
+ *
+ */
+public abstract class GroupManagementCommand  extends ClusteringCommand {
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManagementCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManagementCommand.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManagementCommand.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManagementCommand.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.clustering.management;
+
+import org.apache.axis2.clustering.ClusteringCommand;
+import org.apache.axis2.context.ConfigurationContext;
+
+/**
+ * This class represents the 2-phase commit protocol, where an event is processed,
+ * the system is prepared to switch to a new configuration based on the processed event,
+ * and finally commits the new configuration (i.e. the system switches to the new configuration).
+ * As can be seen, this is a 3-step process.
+ */
+public abstract class NodeManagementCommand extends ClusteringCommand {
+    
+
+    /**//**
+     * Process the <code>event</event>. The implementer of this interface will
+     * need to cache the outcome of this processing.
+     *
+     * @param configContext
+     * @throws Exception
+     *//*
+    public abstract void process(ConfigurationContext configContext) throws Exception;
+
+    *//**
+     * Prepare to switch to the new configuration
+     *
+     * @param configContext
+     *//*
+    public abstract void prepare(ConfigurationContext configContext);
+
+    *//**
+     * Commit the new configuration. i.e. switch the system to the new configuration
+     *
+     * @param configContext
+     * @throws Exception
+     *//*
+    public abstract void commit(ConfigurationContext configContext) throws Exception;
+
+    *//**
+     * Rollback any changes carried out
+     *
+     * @param configContext
+     * @throws Exception
+     *//*
+    public abstract void rollback(ConfigurationContext configContext) throws Exception;*/
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManager.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManager.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/management/NodeManager.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.clustering.management;
+
+import org.apache.axis2.clustering.ClusteringFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.ParameterInclude;
+
+/**
+ * <p>
+ * This interface is responsible for handling configuration management. Configuraion changes include
+ * <p/>
+ * <ul>
+ * <li>Rebooting an entire cluster, in which case, all nodes have to load the new Axis2 configuration
+ * in a consistent manner
+ * </li>
+ * <li>
+ * Deploying a new service to a cluster or undeploying a service from a cluster
+ * </li>
+ * <li>
+ * Changing the policies of a service deployed on the cluster
+ * </li>
+ * </ul>
+ * </p>
+ * <p>
+ * It is not mandatory to have a NodeManager in a node. In which case the cluster may be
+ * used only for <a href="http://afkham.org/2008/05/definition-of-high-availability.html">
+ * High Availability</a> through context replication. However, it is difficult to imagine that
+ * a cluster will be deployed in production with only context replication but without cluster
+ * configuration management.
+ * </p>
+ * <p>
+ * The implementation of this interface is set by the
+ * {@link org.apache.axis2.deployment.ClusterBuilder}, by
+ * reading the  "configurationManager" element in the axis2.xml
+ * <p/>
+ * e.g.
+ * <code>
+ * <b>
+ * <configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
+ * </b>
+ * </code>
+ * </p>
+ */
+public interface NodeManager extends ParameterInclude {
+
+    // ###################### Configuration management methods ##########################
+    /**//**
+     * Load a set of service groups
+     *
+     * @param serviceGroupNames The set of service groups to be loaded
+     * @throws ClusteringFault If an error occurs while loading service groups
+     *//*
+    void loadServiceGroups(String[] serviceGroupNames) throws ClusteringFault;
+
+    *//**
+     * Unload a set of service groups
+     *
+     * @param serviceGroupNames The set of service groups to be unloaded
+     * @throws ClusteringFault If an error occurs while unloading service groups
+     *//*
+    void unloadServiceGroups(String[] serviceGroupNames) throws ClusteringFault;
+
+    *//**
+     * Apply a policy to a service
+     *
+     * @param serviceName The name of the service to which this policy needs to be applied
+     * @param policy      The serialized policy to be applied to the service
+     * @throws ClusteringFault If an error occurs while applying service policies
+     *//*
+    void applyPolicy(String serviceName, String policy) throws ClusteringFault;
+
+    *//**
+     * Reload the entire configuration of an Axis2 Node
+     *
+     * @throws ClusteringFault If an error occurs while reinitializing Axis2
+     *//*
+    void reloadConfiguration() throws ClusteringFault;*/
+
+    // ###################### Transaction management methods ##########################
+
+    /**
+     * First phase of the 2-phase commit protocol.
+     * Notifies a node that it needs to prepare to switch to a new configuration.
+     *
+     * @throws ClusteringFault If an error occurs while preparing to commit
+     */
+    void prepare() throws ClusteringFault;
+
+    /**
+     * Rollback whatever was done
+     *
+     * @throws ClusteringFault If an error occurs while rolling back a cluster configuration
+     *                         transaction
+     */
+    void rollback() throws ClusteringFault;
+
+    /**
+     * Second phase of the 2-phase commit protocol.
+     * Notifies a node that it needs to switch to a new configuration.
+     *
+     * @throws ClusteringFault If an error occurs while committing a cluster configuration
+     *                         transaction
+     */
+    void commit() throws ClusteringFault;
+
+    // ######################## General management methods ############################
+    /**
+     * To notify other nodes that an Exception occurred, during the processing
+     * of a {@link NodeManagementCommand}
+     *
+     * @param throwable The throwable which has to be propogated to other nodes
+     * @throws org.apache.axis2.clustering.ClusteringFault
+     *          If an error occurs while processing the
+     *          exception message
+     */
+    void exceptionOccurred(Throwable throwable) throws ClusteringFault;
+
+    /**
+     * Set the system's configuration context. This will be used by the clustering implementations
+     * to get information about the Axis2 environment and to correspond with the Axis2 environment
+     *
+     * @param configurationContext The configuration context
+     */
+    void setConfigurationContext(ConfigurationContext configurationContext);
+
+    /**
+     * Execute a NodeManagementCommand
+     * 
+     * @param command  The command to be executed
+     * @throws ClusteringFault If an error occurs while sending the message
+     */
+    void sendMessage(NodeManagementCommand command) throws ClusteringFault;
+}
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/Replicator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/Replicator.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/Replicator.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/Replicator.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.clustering.state;
+
+import org.apache.axis2.clustering.ClusteringAgent;
+import org.apache.axis2.clustering.ClusteringFault;
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Replicates serializable properties
+ */
+public final class Replicator {
+
+    private static final Log log = LogFactory.getLog(Replicator.class);
+
+    /**
+     * Replicates all serializable properties in the ConfigurationContext, ServiceGroupContext &
+     * ServiceContext
+     *
+     * @param msgContext The MessageContext associated with the ServiceContext,
+     *                   ServiceGroupContext and ConfigurationContext to be replicated
+     * @throws ClusteringFault If replication fails
+     */
+    public static void replicate(MessageContext msgContext) throws ClusteringFault {
+        if (!canReplicate(msgContext)) {
+            return;
+        }
+        log.debug("Going to replicate state stored in ConfigurationContext," +
+                  " ServiceGroupContext, ServiceContext associated with " + msgContext + "...");
+        ConfigurationContext configurationContext = msgContext.getConfigurationContext();
+        StateManager stateManager = getContextManager(msgContext);
+        List contexts = new ArrayList();
+
+        // Do we need to replicate state stored in ConfigurationContext?
+        if (!configurationContext.getPropertyDifferences().isEmpty()) {
+            contexts.add(configurationContext);
+        }
+
+        // Do we need to replicate state stored in ServiceGroupContext?
+        ServiceGroupContext sgContext = msgContext.getServiceGroupContext();
+        if (sgContext != null && !sgContext.getPropertyDifferences().isEmpty()) {
+            contexts.add(sgContext);
+        }
+
+        // Do we need to replicate state stored in ServiceContext?
+        ServiceContext serviceContext = msgContext.getServiceContext();
+        if (serviceContext != null && !serviceContext.getPropertyDifferences().isEmpty()) {
+            contexts.add(serviceContext);
+        }
+
+        // Do the actual replication here
+        if (!contexts.isEmpty()) {
+            AbstractContext[] contextArray =
+                    (AbstractContext[]) contexts.toArray(new AbstractContext[contexts.size()]);
+            stateManager.updateContexts(contextArray);
+        }
+    }
+
+    /**
+     * Replicate all serializable properties stored in the given <code>abstractContext</code>.
+     *
+     * @param abstractContext The AbstractContext which holds the properties to be replicated
+     * @throws ClusteringFault If replication fails
+     */
+    public static void replicate(AbstractContext abstractContext) throws ClusteringFault {
+        if (!canReplicate(abstractContext)) {
+            return;
+        }
+        log.debug("Going to replicate state in " + abstractContext + "...");
+        StateManager stateManager = getContextManager(abstractContext);
+        if (!abstractContext.getPropertyDifferences().isEmpty()) {
+            stateManager.updateContext(abstractContext);
+        }
+    }
+
+    /**
+     * Replicate all the properties given in <code>propertyNames</code>
+     * in the specified <code>abstractContext</code>
+     *
+     * @param abstractContext The context to be replicated
+     * @param propertyNames   The names of the properties to be replicated
+     * @throws ClusteringFault IF replication fails
+     */
+    public static void replicate(AbstractContext abstractContext,
+                                 String[] propertyNames) throws ClusteringFault {
+        if (!canReplicate(abstractContext)) {
+            return;
+        }
+        log.debug("Going to replicate selected properties in " + abstractContext + "...");
+        StateManager stateManager = getContextManager(abstractContext);
+        stateManager.updateContext(abstractContext, propertyNames);
+    }
+
+    private static ClusteringAgent getClusterManager(AbstractContext abstractContext) {
+        return abstractContext.getRootContext().getAxisConfiguration().getClusteringAgent();
+    }
+
+    private static StateManager getContextManager(AbstractContext abstractContext) {
+        return getClusterManager(abstractContext).getStateManager();
+    }
+
+    /**
+     * Check whether the state store in the specified <code>abstractContext</code> can be replicated.
+     * Also note that if there are no members, we need not do any replication
+     *
+     * @param abstractContext The context to be subjected to this test
+     * @return true - State needs to be replicated
+     *         false - otherwise
+     */
+    private static boolean canReplicate(AbstractContext abstractContext) {
+        ClusteringAgent clusteringAgent =
+                abstractContext.getRootContext().getAxisConfiguration().getClusteringAgent();
+        boolean canReplicate = false;
+        if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
+            canReplicate =
+                    clusteringAgent.getStateManager().isContextClusterable(abstractContext);
+        }
+        return canReplicate;
+    }
+
+    /**
+     * Check whether the state store in the specified <code>messageContext</code> can be replicated.
+     * Also note that if there are no members, we need not do any replication
+     *
+     * @param messageContext The MessageContext to be subjected to this test
+     * @return true - State needs to be replicated
+     *         false - otherwise
+     */
+    private static boolean canReplicate(MessageContext messageContext) {
+        ClusteringAgent clusteringAgent =
+                messageContext.getRootContext().getAxisConfiguration().getClusteringAgent();
+        return clusteringAgent != null && clusteringAgent.getStateManager() != null;
+    }
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateClusteringCommand.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateClusteringCommand.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateClusteringCommand.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateClusteringCommand.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.clustering.state;
+
+import org.apache.axis2.clustering.ClusteringCommand;
+import org.apache.axis2.clustering.ClusteringFault;
+import org.apache.axis2.context.ConfigurationContext;
+
+public abstract class StateClusteringCommand extends ClusteringCommand {
+
+}

Added: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateManager.java?rev=744900&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateManager.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/state/StateManager.java Mon Feb 16 12:02:42 2009
@@ -0,0 +1,151 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.clustering.state;
+
+import org.apache.axis2.clustering.ClusteringFault;
+import org.apache.axis2.context.AbstractContext;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.ParameterInclude;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * This interface is responsible for handling context replication. The property changes in the
+ * <a href="http://www.ibm.com/developerworks/webservices/library/ws-apacheaxis2/">
+ * Axis2 context hierarchy
+ * </a> in this node, are propagated to all other nodes in the cluster.
+ * </p>
+ * <p>
+ * It is not mandatory to have a StateManager in a node. If we are not interested in
+ * <a href="http://afkham.org/2008/05/definition-of-high-availability.html">
+ * High Availability</a>, we may disable context replication by commenting out the "contextManager"
+ * section in the axis2.xml cluster configuration section. In such a scenatio, the cluster will be
+ * used only for the purpose of
+ * <a href="http://afkham.org/2008/05/definition-of-scalability.html">Scalability</a>
+ * </p>
+ * <p>
+ * The implementation of this interface is set by the
+ * {@link org.apache.axis2.deployment.ClusterBuilder}, by
+ * reading the  "contextManager" element in the axis2.xml
+ * <p/>
+ * e.g.
+ * <code>
+ * <b>
+ * <contextManager class="org.apache.axis2.cluster.configuration.TribesContextManager">
+ * </b>
+ * </code>
+ * </p>
+ */
+public interface StateManager extends ParameterInclude {
+
+    /**
+     * This method is called when properties in an {@link AbstractContext} are updated.
+     * This could be addition of new properties, modifications of existing properties or
+     * removal of properties.
+     *
+     * @param context The context to be replicated
+     * @throws ClusteringFault If replication fails
+     */
+    void updateContext(AbstractContext context) throws ClusteringFault;
+
+    /**
+     * This method is called when one need to update/replicate only certains properties in the
+     * specified <code>context</code>
+     *
+     * @param context       The AbstractContext containing the properties to be replicated
+     * @param propertyNames The names of the specific properties that should be replicated
+     * @throws ClusteringFault If replication fails
+     */
+    void updateContext(AbstractContext context, String[] propertyNames) throws ClusteringFault;
+
+    /**
+     * This method is called when properties in a collection of {@link AbstractContext}s are updated.
+     * This could be addition of new properties, modifications of existing properties or
+     * removal of properties.
+     *
+     * @param contexts The AbstractContexts containing the properties to be replicated
+     * @throws ClusteringFault If replication fails
+     */
+    void updateContexts(AbstractContext[] contexts) throws ClusteringFault;
+
+    /**
+     * This method is called when {@link AbstractContext} is removed from the system
+     *
+     * @param context The AbstractContext to be removed
+     * @throws ClusteringFault If context removal fails
+     */
+    void removeContext(AbstractContext context) throws ClusteringFault;
+
+    /**
+     * This is a check to see whether the properties in an instance of {@link AbstractContext}
+     * should be replicated. This allows an implementer to dissallow the replication of properties
+     * stored in a certain type of context
+     *
+     * @param context The instance of AbstractContext under consideration
+     * @return True - if the provided {@link AbstractContext}  is clusterable
+     */
+    boolean isContextClusterable(AbstractContext context);
+
+    /**
+     * Set the system's configuration context. This will be used by the clustering implementations
+     * to get information about the Axis2 environment and to correspond with the Axis2 environment
+     *
+     * @param configurationContext The configuration context
+     */
+    void setConfigurationContext(ConfigurationContext configurationContext);
+
+    /**
+     * <p>
+     * All properties in the context with type <code>contextType</code> which have
+     * names that match the specified pattern will be excluded from replication.
+     * </p>
+     * <p/>
+     * <p>
+     * Only prefixes and suffixes are allowed. e.g. the local_* pattern indicates that
+     * all property names starting with local_ should be omitted from replication. *_local pattern
+     * indicated that all property names ending with _local should be omitted from replication.
+     * * pattern indicates that all properties should be excluded.
+     * </p>
+     * <p>
+     * Generally, we can use the context class name as the context type.
+     * </p>
+     *
+     * @param contextType The type of the context such as
+     *                    org.apache.axis2.context.ConfigurationContext,
+     *                    org.apache.axis2.context.ServiceGroupContext &
+     *                    org.apache.axis2.context.ServiceContext.
+     *                    Also "defaults" is a special type, which will apply to all contexts
+     * @param patterns    The patterns
+     */
+    void setReplicationExcludePatterns(String contextType, List patterns);
+
+    /**
+     * Get all the excluded context property name patterns
+     *
+     * @return All the excluded pattern of all the contexts. The key of the Map is the
+     *         the <code>contextType</code>. See {@link #setReplicationExcludePatterns(String,List)}.
+     *         The values are of type {@link List} of {@link String} Objects,
+     *         which are a collection of patterns to be excluded.
+     * @see #setReplicationExcludePatterns(String, java.util.List)
+     */
+    Map getReplicationExcludePatterns();
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Mon Feb 16 12:02:42 2009
@@ -27,8 +27,8 @@
 import java.util.Map.Entry;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.clustering.ClusterManager;
-import org.apache.axis2.clustering.context.Replicator;
+import org.apache.axis2.clustering.ClusteringAgent;
+import org.apache.axis2.clustering.state.Replicator;
 import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
@@ -218,9 +218,9 @@
         }
         // Add the property differences only if Context replication is enabled,
         // and there are members in the cluster
-        ClusterManager clusterManager = cc.getAxisConfiguration().getClusterManager();
-        if (clusterManager == null ||
-            clusterManager.getContextManager() == null) {
+        ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
+        if (clusteringAgent == null ||
+            clusteringAgent.getStateManager() == null) {
             return false;
         }
         return true;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java Mon Feb 16 12:02:42 2009
@@ -23,10 +23,10 @@
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.clustering.ClusterManager;
+import org.apache.axis2.clustering.ClusteringAgent;
 import org.apache.axis2.clustering.ClusteringConstants;
-import org.apache.axis2.clustering.configuration.ConfigurationManager;
-import org.apache.axis2.clustering.context.ContextManager;
+import org.apache.axis2.clustering.management.NodeManager;
+import org.apache.axis2.clustering.state.StateManager;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.description.Parameter;
@@ -114,31 +114,31 @@
      * @throws AxisFault
      */
     public void initCluster() throws AxisFault {
-        ClusterManager clusterManager = axisConfiguration.getClusterManager();
-        if (clusterManager != null) {
-            ContextManager contextManager = clusterManager.getContextManager();
-            if (contextManager != null) {
-                contextManager.setConfigurationContext(this);
+        ClusteringAgent clusteringAgent = axisConfiguration.getClusteringAgent();
+        if (clusteringAgent != null) {
+            StateManager stateManaget = clusteringAgent.getStateManager();
+            if (stateManaget != null) {
+                stateManaget.setConfigurationContext(this);
             }
-            ConfigurationManager configManager = clusterManager.getConfigurationManager();
-            if (configManager != null) {
-                configManager.setConfigurationContext(this);
+            NodeManager nodeManager = clusteringAgent.getNodeManager();
+            if (nodeManager != null) {
+                nodeManager.setConfigurationContext(this);
             }
-            if (shouldClusterBeInitiated(clusterManager)) {
-                clusterManager.setConfigurationContext(this);
-                clusterManager.init();
+            if (shouldClusterBeInitiated(clusteringAgent)) {
+                clusteringAgent.setConfigurationContext(this);
+                clusteringAgent.init();
             }
         }
     }
 
     /**
-     * @param clusterManager The ClusterManager implementation
+     * @param clusteringAgent The ClusterManager implementation
      * @return true, if the cluster needs to be automatically initialized by the framework; false,
      *         otherwise
      */
-    private static boolean shouldClusterBeInitiated(ClusterManager clusterManager) {
+    private static boolean shouldClusterBeInitiated(ClusteringAgent clusteringAgent) {
         Parameter param =
-                clusterManager.getParameter(ClusteringConstants.Parameters.AVOID_INITIATION);
+                clusteringAgent.getParameter(ClusteringConstants.Parameters.AVOID_INITIATION);
         return !(param != null && JavaUtils.isTrueExplicitly(param.getValue()));
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Mon Feb 16 12:02:42 2009
@@ -104,7 +104,7 @@
         }
 
         // Finally initialize the cluster
-        if (axisConfig.getClusterManager() != null) {
+        if (axisConfig.getClusteringAgent() != null) {
             configContext.initCluster();
         }
         
@@ -309,7 +309,7 @@
     public static ConfigurationContext createEmptyConfigurationContext() throws AxisFault {
         AxisConfiguration axisConfiguration = new AxisConfiguration();
         ConfigurationContext configContext = new ConfigurationContext(axisConfiguration);
-        if (axisConfiguration.getClusterManager() != null) {
+        if (axisConfiguration.getClusteringAgent() != null) {
             configContext.initCluster();
         }
 
@@ -340,7 +340,7 @@
         axisConfig.validateSystemPredefinedPhases();
         ConfigurationContext configContext = new ConfigurationContext(axisConfig);
 
-        if (axisConfig.getClusterManager() != null) {
+        if (axisConfig.getClusteringAgent() != null) {
             configContext.initCluster();
         }
 

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=744900&r1=744899&r2=744900&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 Feb 16 12:02:42 2009
@@ -22,14 +22,12 @@
 
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
-import org.apache.axis2.clustering.ClusterManager;
+import org.apache.axis2.clustering.ClusteringAgent;
 import org.apache.axis2.clustering.ClusteringConstants;
 import org.apache.axis2.clustering.Member;
-import org.apache.axis2.clustering.LoadBalanceEventHandler;
-import org.apache.axis2.clustering.configuration.ConfigurationManager;
-import org.apache.axis2.clustering.configuration.ConfigurationManagerListener;
-import org.apache.axis2.clustering.context.ContextManager;
-import org.apache.axis2.clustering.context.ContextManagerListener;
+import org.apache.axis2.clustering.management.GroupManagementAgent;
+import org.apache.axis2.clustering.management.NodeManager;
+import org.apache.axis2.clustering.state.StateManager;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
@@ -74,7 +72,7 @@
         }
 
         String className = classNameAttr.getAttributeValue();
-        ClusterManager clusterManager;
+        ClusteringAgent clusteringAgent;
         try {
             Class clazz;
             try {
@@ -83,28 +81,28 @@
                 throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                   className));
             }
-            clusterManager = (ClusterManager) clazz.newInstance();
+            clusteringAgent = (ClusteringAgent) clazz.newInstance();
 
-            clusterManager.setConfigurationContext(configCtx);
+            clusteringAgent.setConfigurationContext(configCtx);
 
             //loading the parameters.
             processParameters(clusterElement.getChildrenWithName(new QName(TAG_PARAMETER)),
-                              clusterManager,
+                              clusteringAgent,
                               null);
 
             // loading the application domains
-            loadApplicationDomains(clusterManager, clusterElement);
+            loadGroupManagement(clusteringAgent, clusterElement);
 
             // loading the members
-            loadWellKnownMembers(clusterManager, clusterElement);
+            loadWellKnownMembers(clusteringAgent, clusterElement);
 
-            //loading the ConfigurationManager
-            loadConfigManager(clusterElement, clusterManager);
+            //loading the NodeManager
+            loadNodeManager(clusterElement, clusteringAgent);
 
-            // loading the ContextManager
-            loadContextManager(clusterElement, clusterManager);
+            // loading the StateManager
+            loadStateManager(clusterElement, clusteringAgent);
 
-            axisConfig.setClusterManager(clusterManager);
+            axisConfig.setClusteringAgent(clusteringAgent);
         } catch (InstantiationException e) {
             throw new DeploymentException(Messages.getMessage("cannotLoadClusterImpl"));
         } catch (IllegalAccessException e) {
@@ -121,12 +119,12 @@
         return enabled;
     }
 
-    private void loadApplicationDomains(ClusterManager clusterManager,
-                                        OMElement clusterElement) throws DeploymentException {
-        OMElement lbEle = clusterElement.getFirstChildWithName(new QName("loadBalancer"));
+    private void loadGroupManagement(ClusteringAgent clusteringAgent,
+                                     OMElement clusterElement) throws DeploymentException {
+        OMElement lbEle = clusterElement.getFirstChildWithName(new QName("groupManagement"));
         if (lbEle != null) {
             if (isEnabled(lbEle)) {
-                log.info("Running in load balance mode");
+                log.info("Running in group management mode");
             } else {
                 log.info("Running in application mode");
                 return;
@@ -136,24 +134,30 @@
                  iter.hasNext();) {
                 OMElement omElement = (OMElement) iter.next();
                 String domainName = omElement.getAttributeValue(new QName("name")).trim();
-                String handlerClass = omElement.getAttributeValue(new QName("handler")).trim();
-                LoadBalanceEventHandler eventHandler;
+                String handlerClass = omElement.getAttributeValue(new QName("agent")).trim();
+                String descAttrib = omElement.getAttributeValue(new QName("description"));
+                String description = "Description not found";
+                if (descAttrib != null) {
+                    description = descAttrib.trim();
+                }
+                GroupManagementAgent eventHandler;
                 try {
-                    eventHandler = (LoadBalanceEventHandler) Class.forName(handlerClass).newInstance();
+                    eventHandler = (GroupManagementAgent) Class.forName(handlerClass).newInstance();
+                    eventHandler.setDescription(description);
                 } catch (Exception e) {
-                    String msg = "Could not instantiate LoadBalanceEventHandler " + handlerClass +
+                    String msg = "Could not instantiate GroupManagementAgent " + handlerClass +
                                  " for domain " + domainName;
                     log.error(msg, e);
                     throw new DeploymentException(msg, e);
                 }
-                clusterManager.addLoadBalanceEventHandler(eventHandler, domainName);
+                clusteringAgent.addGroupManagementAgent(eventHandler, domainName);
             }
         }
     }
 
-    private void loadWellKnownMembers(ClusterManager clusterManager, OMElement clusterElement) {
-        clusterManager.setMembers(new ArrayList<Member>());
-        Parameter membershipSchemeParam = clusterManager.getParameter("membershipScheme");
+    private void loadWellKnownMembers(ClusteringAgent clusteringAgent, OMElement clusterElement) {
+        clusteringAgent.setMembers(new ArrayList<Member>());
+        Parameter membershipSchemeParam = clusteringAgent.getParameter("membershipScheme");
         if (membershipSchemeParam != null) {
             String membershipScheme = ((String) membershipSchemeParam.getValue()).trim();
             if (membershipScheme.equals(ClusteringConstants.MembershipScheme.WKA_BASED)) {
@@ -171,7 +175,7 @@
                                                Integer.parseInt(replaceVariables(port))));
                     }
                 }
-                clusterManager.setMembers(members);
+                clusteringAgent.setMembers(members);
             }
         }
     }
@@ -200,25 +204,25 @@
         return text;
     }
 
-    private void loadContextManager(OMElement clusterElement,
-                                    ClusterManager clusterManager) throws DeploymentException,
+    private void loadStateManager(OMElement clusterElement,
+                                    ClusteringAgent clusteringAgent) throws DeploymentException,
                                                                           InstantiationException,
                                                                           IllegalAccessException {
         OMElement contextManagerEle =
-                clusterElement.getFirstChildWithName(new QName(TAG_CONTEXT_MANAGER));
+                clusterElement.getFirstChildWithName(new QName(TAG_STATE_MANAGER));
         if (contextManagerEle != null) {
             if (!isEnabled(contextManagerEle)) {
-                log.info("Clustering context management has been disabled");
+                log.info("Clustering state management has been disabled");
                 return;
             }
-            log.info("Clustering context management has been enabled");
+            log.info("Clustering state management has been enabled");
 
-            // Load & set the ContextManager class
+            // Load & set the StateManager class
             OMAttribute classNameAttr =
                     contextManagerEle.getAttribute(new QName(ATTRIBUTE_CLASS));
             if (classNameAttr == null) {
                 throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
-                                                                  TAG_CONTEXT_MANAGER));
+                                                                  TAG_STATE_MANAGER));
             }
 
             String className = classNameAttr.getAttributeValue();
@@ -230,34 +234,12 @@
                 throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
                                                                   className));
             }
-            ContextManager contextManager = (ContextManager) clazz.newInstance();
-            clusterManager.setContextManager(contextManager);
-
-            // Load & set the ContextManagerListener
-            OMElement listenerEle =
-                    contextManagerEle.getFirstChildWithName(new QName(TAG_LISTENER));
-            if (listenerEle != null) {
-                classNameAttr = listenerEle.getAttribute(new QName(TAG_CLASS_NAME));
-                if (classNameAttr == null) {
-                    throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
-                                                                      TAG_LISTENER));
-                }
-                className = classNameAttr.getAttributeValue();
-                try {
-                    clazz = Class.forName(className);
-                } catch (ClassNotFoundException e) {
-                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
-                                                                      className));
-                }
-                ContextManagerListener listener = (ContextManagerListener) clazz.newInstance();
-                contextManager.setContextManagerListener(listener);
-            } else {
-                throw new DeploymentException(Messages.getMessage("contextManagerListenerIsNull"));
-            }
+            StateManager stateManager = (StateManager) clazz.newInstance();
+            clusteringAgent.setStateManager(stateManager);
 
             //loading the parameters.
             processParameters(contextManagerEle.getChildrenWithName(new QName(TAG_PARAMETER)),
-                              contextManager,
+                              stateManager,
                               null);
 
             // Load the replication patterns to be excluded. We load the following structure.
@@ -282,14 +264,14 @@
                 OMElement defaultsEle =
                         replicationEle.getFirstChildWithName(new QName(TAG_DEFAULTS));
                 if (defaultsEle != null) {
-                    List defaults = new ArrayList();
+                    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());
                     }
-                    contextManager.setReplicationExcludePatterns(TAG_DEFAULTS, defaults);
+                    stateManager.setReplicationExcludePatterns(TAG_DEFAULTS, defaults);
                 }
 
                 // Process specifics
@@ -298,25 +280,25 @@
                     OMElement contextEle = (OMElement) iter.next();
                     String ctxClassName =
                             contextEle.getAttribute(new QName(ATTRIBUTE_CLASS)).getAttributeValue();
-                    List excludes = new ArrayList();
+                    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());
                     }
-                    contextManager.setReplicationExcludePatterns(ctxClassName, excludes);
+                    stateManager.setReplicationExcludePatterns(ctxClassName, excludes);
                 }
             }
         }
     }
 
-    private void loadConfigManager(OMElement clusterElement,
-                                   ClusterManager clusterManager) throws DeploymentException,
+    private void loadNodeManager(OMElement clusterElement,
+                                   ClusteringAgent clusteringAgent) throws DeploymentException,
                                                                          InstantiationException,
                                                                          IllegalAccessException {
         OMElement configManagerEle =
-                clusterElement.getFirstChildWithName(new QName(TAG_CONFIGURATION_MANAGER));
+                clusterElement.getFirstChildWithName(new QName(TAG_NODE_MANAGER));
         if (configManagerEle != null) {
             if (!isEnabled(configManagerEle)) {
                 log.info("Clustering configuration management has been disabled");
@@ -327,7 +309,7 @@
             OMAttribute classNameAttr = configManagerEle.getAttribute(new QName(ATTRIBUTE_CLASS));
             if (classNameAttr == null) {
                 throw new DeploymentException(Messages.getMessage("classAttributeNotFound",
-                                                                  TAG_CONFIGURATION_MANAGER));
+                                                                  TAG_NODE_MANAGER));
             }
 
             String className = classNameAttr.getAttributeValue();
@@ -339,39 +321,15 @@
                                                                   className));
             }
 
-            ConfigurationManager configurationManager =
-                    (ConfigurationManager) clazz.newInstance();
-            clusterManager.setConfigurationManager(configurationManager);
-
-            OMElement listenerEle =
-                    configManagerEle.getFirstChildWithName(new QName(TAG_LISTENER));
-            if (listenerEle != null) {
-                classNameAttr = listenerEle.getAttribute(new QName(TAG_CLASS_NAME));
-                if (classNameAttr == null) {
-                    throw new DeploymentException(Messages.getMessage("clusterImplNotFound",
-                                                                      TAG_LISTENER));
-                }
-
-                className = classNameAttr.getAttributeValue();
-                try {
-                    clazz = Class.forName(className);
-                } catch (ClassNotFoundException e) {
-                    throw new DeploymentException(Messages.getMessage("configurationManagerListenerIsNull"));
-                }
-                ConfigurationManagerListener listener = (ConfigurationManagerListener) clazz
-                        .newInstance();
-                listener.setConfigurationContext(configCtx);
-                configurationManager.setConfigurationManagerListener(listener);
-            } else {
-                throw new DeploymentException(Messages.getMessage("configurationManagerListenerIsNull"));
-            }
+            NodeManager nodeManager = (NodeManager) clazz.newInstance();
+            clusteringAgent.setNodeManager(nodeManager);
 
-            //updating the ConfigurationManager with the new ConfigurationContext
-            configurationManager.setConfigurationContext(configCtx);
+            //updating the NodeManager with the new ConfigurationContext
+            nodeManager.setConfigurationContext(configCtx);
 
             //loading the parameters.
             processParameters(configManagerEle.getChildrenWithName(new QName(TAG_PARAMETER)),
-                              configurationManager,
+                              nodeManager,
                               null);
         }
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Mon Feb 16 12:02:42 2009
@@ -104,8 +104,8 @@
     String TAG_NAMESPACES = "namespaces";
 
     //ClusterBuilder
-    String TAG_CONFIGURATION_MANAGER = "configurationManager";
-    String TAG_CONTEXT_MANAGER = "contextManager";
+    String TAG_NODE_MANAGER = "nodeManager";
+    String TAG_STATE_MANAGER = "stateManager";
     String TAG_REPLICATION = "replication";
     String TAG_DEFAULTS = "defaults";
     String TAG_CONTEXT = "context";

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java Mon Feb 16 12:02:42 2009
@@ -37,7 +37,7 @@
 import org.apache.axis2.transaction.TransactionConfiguration;
 import org.apache.axis2.builder.Builder;
 import org.apache.axis2.builder.unknowncontent.UnknownContentBuilder;
-import org.apache.axis2.clustering.ClusterManager;
+import org.apache.axis2.clustering.ClusteringAgent;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.dataretrieval.AxisDataLocator;
 import org.apache.axis2.deployment.DeploymentException;
@@ -145,7 +145,7 @@
 
     private ArrayList<TargetResolver> targetResolvers;
 
-    private ClusterManager clusterManager;
+    private ClusteringAgent clusteringAgent;
 
     private AxisConfigurator configurator;
 
@@ -1018,12 +1018,12 @@
         }
     }
 
-    public ClusterManager getClusterManager() {
-        return clusterManager;
+    public ClusteringAgent getClusteringAgent() {
+        return clusteringAgent;
     }
 
-    public void setClusterManager(ClusterManager clusterManager) {
-        this.clusterManager = clusterManager;
+    public void setClusteringAgent(ClusteringAgent clusteringAgent) {
+        this.clusteringAgent = clusteringAgent;
     }
 
      public TransactionConfiguration getTransactionConfiguration() {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisServer.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisServer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisServer.java Mon Feb 16 12:02:42 2009
@@ -20,7 +20,7 @@
 package org.apache.axis2.engine;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.clustering.ClusterManager;
+import org.apache.axis2.clustering.ClusteringAgent;
 import org.apache.axis2.clustering.ClusteringConstants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
@@ -88,14 +88,14 @@
         }
         if (!started) {
 
-            ClusterManager clusterManager =
-                    configContext.getAxisConfiguration().getClusterManager();
+            ClusteringAgent clusteringAgent =
+                    configContext.getAxisConfiguration().getClusteringAgent();
             String avoidInit = ClusteringConstants.Parameters.AVOID_INITIATION;
-            if (clusterManager != null &&
-                clusterManager.getParameter(avoidInit) != null &&
-                ((String) clusterManager.getParameter(avoidInit).getValue()).equalsIgnoreCase("true")) {
-                clusterManager.setConfigurationContext(configContext);
-                clusterManager.init();
+            if (clusteringAgent != null &&
+                clusteringAgent.getParameter(avoidInit) != null &&
+                ((String) clusteringAgent.getParameter(avoidInit).getValue()).equalsIgnoreCase("true")) {
+                clusteringAgent.setConfigurationContext(configContext);
+                clusteringAgent.init();
             }
 
             listenerManager.startSystem(configContext);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java?rev=744900&r1=744899&r2=744900&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java Mon Feb 16 12:02:42 2009
@@ -29,7 +29,7 @@
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.classloader.MultiParentClassLoader;
 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.MessageContext;
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.description.AxisService;