Author: azeez
Date: Fri Jun  1 08:13:21 2007
New Revision: 543500

URL: http://svn.apache.org/viewvc?view=rev&rev=543500
Log:
Cleaning up the code after removing addContext & removeContext operations


Removed:
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ServiceContextCommand.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ServiceGroupContextCommand.java
Modified:
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ContextClusteringCommandCollection.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateConfigurationContextCommand.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateContextCommand.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
    
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/ControlCommand.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusteringCommand.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/configuration/ConfigurationClusteringCommand.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextClusteringCommand.java
    
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManagerListener.java

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/ContextClusteringCommandFactory.java
 Fri Jun  1 08:13:21 2007
@@ -67,44 +67,36 @@
                                                             Map 
excludedPropertyPatterns,
                                                             boolean 
includeAllProperties) {
 
-        ContextClusteringCommand cmd = null;
+        UpdateContextCommand cmd = null;
         if (context instanceof ConfigurationContext) {
             cmd = new UpdateConfigurationContextCommand();
-            cmd.setUniqueId(UUIDGenerator.getUUID());
-            fillProperties((UpdateContextCommand) cmd,
-                           context,
-                           excludedPropertyPatterns,
-                           includeAllProperties);
         } else if (context instanceof ServiceGroupContext) {
             ServiceGroupContext sgCtx = (ServiceGroupContext) context;
             cmd = new UpdateServiceGroupContextCommand();
-            cmd.setUniqueId(UUIDGenerator.getUUID());
             UpdateServiceGroupContextCommand updateSgCmd = 
(UpdateServiceGroupContextCommand) cmd;
             
updateSgCmd.setServiceGroupName(sgCtx.getDescription().getServiceGroupName());
             updateSgCmd.setServiceGroupContextId(sgCtx.getId());
-            fillProperties((UpdateContextCommand) cmd,
-                           context,
-                           excludedPropertyPatterns,
-                           includeAllProperties);
         } else if (context instanceof ServiceContext) {
             ServiceContext serviceCtx = (ServiceContext) context;
             cmd = new UpdateServiceContextCommand();
-            cmd.setUniqueId(UUIDGenerator.getUUID());
             UpdateServiceContextCommand updateServiceCmd = 
(UpdateServiceContextCommand) cmd;
             String sgName =
                     
serviceCtx.getServiceGroupContext().getDescription().getServiceGroupName();
             updateServiceCmd.setServiceGroupName(sgName);
             
updateServiceCmd.setServiceGroupContextId(serviceCtx.getServiceGroupContext().getId());
             
updateServiceCmd.setServiceName(serviceCtx.getAxisService().getName());
-            fillProperties((UpdateContextCommand) cmd,
+        }
+        if (cmd != null) {
+            cmd.setUniqueId(UUIDGenerator.getUUID());
+            fillProperties(cmd,
                            context,
                            excludedPropertyPatterns,
                            includeAllProperties);
-        }
-        if (cmd != null && ((UpdateContextCommand) cmd).isPropertiesEmpty()) {
-            cmd = null;
-        } else {
-            AckManager.addInitialAcknowledgement(cmd);
+            if (cmd.isPropertiesEmpty()) {
+                cmd = null;
+            } else {
+                AckManager.addInitialAcknowledgement(cmd);
+            }
         }
         context.clearPropertyDifferences(); // Once we send the diffs, we 
should clear the diffs
         return cmd;
@@ -130,7 +122,8 @@
                     if (prop instanceof Serializable) { // First check whether 
it is serializable
 
                         // Next check whether it matches an excluded pattern
-                        if (!isExcluded(key, context.getClass().getName(), 
excludedPropertyPatterns)) {
+                        if (!isExcluded(key, context.getClass().getName(), 
excludedPropertyPatterns))
+                        {
                             log.debug("sending property =" + key + "-" + prop);
                             PropertyDifference diff = (PropertyDifference) 
diffs.get(key);
                             diff.setValue(prop);
@@ -147,7 +140,8 @@
                     if (prop instanceof Serializable) { // First check whether 
it is serializable
 
                         // Next check whether it matches an excluded pattern
-                        if (!isExcluded(key, context.getClass().getName(), 
excludedPropertyPatterns)) {
+                        if (!isExcluded(key, context.getClass().getName(), 
excludedPropertyPatterns))
+                        {
                             log.debug("sending property =" + key + "-" + prop);
                             PropertyDifference diff = new 
PropertyDifference(key, prop, false);
                             updateCmd.addProperty(diff);

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManagerListener.java
 Fri Jun  1 08:13:21 2007
@@ -26,18 +26,6 @@
     private ConfigurationContext configurationContext;
     private static final Log log = 
LogFactory.getLog(DefaultContextManagerListener.class);
 
-    public void contextAdded(ContextClusteringCommand message) throws 
ClusteringFault {
-        log.debug("Enter: DefaultContextManagerListener::contextAdded");
-        message.execute(configurationContext);
-        log.debug("Exit: DefaultContextManagerListener::contextAdded");
-    }
-
-    public void contextRemoved(ContextClusteringCommand message) throws 
ClusteringFault {
-        log.debug("Enter: DefaultContextManagerListener::contextRemoved");
-        message.execute(configurationContext);
-        log.debug("Exit: DefaultContextManagerListener::contextRemoved");
-    }
-
     public void contextUpdated(ContextClusteringCommand message) throws 
ClusteringFault {
         log.debug("Enter: DefaultContextManagerListener::contextRemoved");
         message.execute(configurationContext);

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ContextClusteringCommandCollection.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ContextClusteringCommandCollection.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ContextClusteringCommandCollection.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/ContextClusteringCommandCollection.java
 Fri Jun  1 08:13:21 2007
@@ -40,8 +40,4 @@
             }
         }
     }
-
-    public int getCommandType() {
-        return CONTEXT_COMMAND_COLLECTION;
-    }
 }

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateConfigurationContextCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateConfigurationContextCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateConfigurationContextCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateConfigurationContextCommand.java
 Fri Jun  1 08:13:21 2007
@@ -26,17 +26,12 @@
 /**
  * 
  */
-public class UpdateConfigurationContextCommand
-        extends ContextClusteringCommand implements UpdateContextCommand {
+public class UpdateConfigurationContextCommand extends UpdateContextCommand {
 
     private PropertyUpdater propertyUpdater = new PropertyUpdater();
 
     public void execute(ConfigurationContext configurationContext) throws 
ClusteringFault {
         propertyUpdater.updateProperties(configurationContext);
-    }
-
-    public int getCommandType() {
-        return UPDATE_CONFIGURATION_CONTEXT;
     }
 
     public boolean isPropertiesEmpty(){

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateContextCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateContextCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateContextCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateContextCommand.java
 Fri Jun  1 08:13:21 2007
@@ -15,15 +15,15 @@
  */
 package org.apache.axis2.clustering.context.commands;
 
+import org.apache.axis2.clustering.context.ContextClusteringCommand;
 import org.apache.axis2.context.PropertyDifference;
 
-import java.io.Serializable;
-
 /**
  * 
  */
-public interface UpdateContextCommand extends Serializable {
-    void addProperty(PropertyDifference diff);
+public abstract class UpdateContextCommand extends ContextClusteringCommand {
+    public abstract void addProperty(PropertyDifference diff);
+    
 
-    boolean isPropertiesEmpty();
+    public abstract boolean isPropertiesEmpty();
 }

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceContextCommand.java
 Fri Jun  1 08:13:21 2007
@@ -32,12 +32,26 @@
 /**
  * 
  */
-public class UpdateServiceContextCommand
-        extends ServiceContextCommand implements UpdateContextCommand {
+public class UpdateServiceContextCommand extends UpdateContextCommand {
 
     private static final Log log = 
LogFactory.getLog(UpdateServiceContextCommand.class);
 
     private PropertyUpdater propertyUpdater = new PropertyUpdater();
+    protected String serviceGroupName;
+    protected String serviceGroupContextId;
+    protected String serviceName;
+
+    public void setServiceGroupName(String serviceGroupName) {
+        this.serviceGroupName = serviceGroupName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public void setServiceGroupContextId(String serviceGroupContextId) {
+        this.serviceGroupContextId = serviceGroupContextId;
+    }
 
     public void execute(ConfigurationContext configurationContext) throws 
ClusteringFault {
         log.debug("Updating service context properties...");
@@ -89,10 +103,6 @@
             return true;
         }
         return propertyUpdater.getProperties().isEmpty();
-    }
-
-    public int getCommandType() {
-        return UPDATE_SERVICE_CONTEXT;
     }
 
     public void addProperty(PropertyDifference diff) {

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/commands/UpdateServiceGroupContextCommand.java
 Fri Jun  1 08:13:21 2007
@@ -21,17 +21,38 @@
 import org.apache.axis2.context.PropertyDifference;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import java.util.HashMap;
 
 /**
  * 
  */
-public class UpdateServiceGroupContextCommand
-        extends ServiceGroupContextCommand implements UpdateContextCommand {
+public class UpdateServiceGroupContextCommand extends UpdateContextCommand {
 
+    private static Log log = 
LogFactory.getLog(UpdateServiceGroupContextCommand.class);
     private PropertyUpdater propertyUpdater = new PropertyUpdater();
 
+    protected String serviceGroupName;
+    protected String serviceGroupContextId;
+
+    public String getServiceGroupName() {
+        return serviceGroupName;
+    }
+
+    public void setServiceGroupName(String serviceGroupName) {
+        this.serviceGroupName = serviceGroupName;
+    }
+
+    public String getServiceGroupContextId() {
+        return serviceGroupContextId;
+    }
+
+    public void setServiceGroupContextId(String serviceGroupContextId) {
+        this.serviceGroupContextId = serviceGroupContextId;
+    }
+
     public void execute(ConfigurationContext configContext) throws 
ClusteringFault {
         ServiceGroupContext sgCtx =
                 configContext.getServiceGroupContext(serviceGroupContextId);
@@ -45,12 +66,8 @@
             sgCtx.setId(serviceGroupContextId);
             configContext.addServiceGroupContextIntoSoapSessionTable(sgCtx);  
// TODO: Check this
         }
-        System.err.println("###### Gonna update SG prop in " + 
serviceGroupContextId + "===" + sgCtx);
+        log.debug("###### Gonna update SG prop in " + serviceGroupContextId + 
"===" + sgCtx);
         propertyUpdater.updateProperties(sgCtx);
-    }
-
-    public int getCommandType() {
-        return UPDATE_SERVICE_GROUP_CONTEXT;
     }
 
     public boolean isPropertiesEmpty() {

Modified: 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/ControlCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/ControlCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/ControlCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/control/ControlCommand.java
 Fri Jun  1 08:13:21 2007
@@ -20,13 +20,15 @@
 import org.apache.axis2.context.ConfigurationContext;
 
 /**
- * 
+ * Represents a Control command sent from one Node to another
  */
 public abstract class ControlCommand extends ClusteringCommand {
-    public int getCommandType() {
-        //TODO: Method implementation
-        return 0;
-    }
 
+    /**
+     * Execute this command
+     *
+     * @param configurationContext
+     * @throws ClusteringFault
+     */
     public abstract void execute(ConfigurationContext configurationContext) 
throws ClusteringFault;
 }

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusteringCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusteringCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusteringCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/ClusteringCommand.java
 Fri Jun  1 08:13:21 2007
@@ -20,5 +20,4 @@
 
 public abstract class ClusteringCommand implements Serializable {
 
-    public abstract int getCommandType();
 }

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/configuration/ConfigurationClusteringCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/configuration/ConfigurationClusteringCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/configuration/ConfigurationClusteringCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/configuration/ConfigurationClusteringCommand.java
 Fri Jun  1 08:13:21 2007
@@ -37,6 +37,13 @@
     public static final int ROLLBACK = 7;
 
     /**
+     * Get the command type
+     * 
+     * @return The command type
+     */
+    public abstract int getCommandType();
+
+    /**
      * Process the <code>event</event>. The implementer of this interface will
      * need to cache the outcome of this processing.
      *

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextClusteringCommand.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextClusteringCommand.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextClusteringCommand.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextClusteringCommand.java
 Fri Jun  1 08:13:21 2007
@@ -22,16 +22,6 @@
 
 public abstract class ContextClusteringCommand extends ClusteringCommand {
 
-    public static final int CREATE_SERVICE_GROUP_CONTEXT = 0;
-    public static final int CREATE_SERVICE_CONTEXT = 1;
-    public static final int CREATE_SESSION_CONTEXT = 2;
-    public static final int UPDATE_SERVICE_GROUP_CONTEXT = 3;
-    public static final int UPDATE_SERVICE_CONTEXT = 4;
-    public static final int CONTEXT_COMMAND_COLLECTION = 5;
-    public static final int UPDATE_CONFIGURATION_CONTEXT = 6;
-    public static final int DELETE_SERVICE_GROUP_CONTEXT = 7;
-    public static final int DELETE_SERVICE_CONTEXT = 8;
-
     private String uniqueId;
 
     public abstract void execute(ConfigurationContext configContext) throws 
ClusteringFault;

Modified: 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManagerListener.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManagerListener.java?view=diff&rev=543500&r1=543499&r2=543500
==============================================================================
--- 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManagerListener.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManagerListener.java
 Fri Jun  1 08:13:21 2007
@@ -21,10 +21,6 @@
 
 public interface ContextManagerListener {
     
-    public void contextAdded(ContextClusteringCommand message) throws 
ClusteringFault;
-
-    public void contextRemoved(ContextClusteringCommand message) throws 
ClusteringFault;
-
     public void contextUpdated(ContextClusteringCommand message) throws 
ClusteringFault;
 
     public void setConfigurationContext(ConfigurationContext 
configurationContext);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to