axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r520848 - in /webservices/axis2/trunk/java/modules: clustering/src/org/apache/axis2/cluster/tribes/configuration/ clustering/test/org/apache/axis2/clustering/ clustering/test/org/apache/axis2/clustering/configuration/ kernel/src/org/apache/...
Date Wed, 21 Mar 2007 11:55:39 GMT
Author: azeez
Date: Wed Mar 21 04:55:38 2007
New Revision: 520848

URL: http://svn.apache.org/viewvc?view=rev&rev=520848
Log:
Removing the setAxisConfiguration method and adding setConfigurationContext method to ConfigurationManager
Handling a possible NPE


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
    webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
    webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/TestConfigurationManagerListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManager.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManagerListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
Wed Mar 21 04:55:38 2007
@@ -23,6 +23,7 @@
 import org.apache.axis2.cluster.configuration.ConfigurationManagerListener;
 import org.apache.axis2.cluster.tribes.ChannelSender;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.ChannelException;
 import org.apache.catalina.tribes.Member;
@@ -36,15 +37,15 @@
 
     private List listeners = null;
     private ChannelSender sender = null;
-    private AxisConfiguration axisConfiguration = null;
+    private ConfigurationContext configurationContext = null;
 
     public TribesConfigurationManager() {
         listeners = new ArrayList();
     }
 
     public void addConfigurationManagerListener(ConfigurationManagerListener listener) {
-        if (axisConfiguration != null) {
-            listener.setAxisConfiguration(axisConfiguration);
+        if (configurationContext != null) {
+            listener.setConfigurationContext(configurationContext);
         }
 
         listeners.add(listener);
@@ -138,8 +139,8 @@
         }
     }
 
-    public void setAxisConfiguration(AxisConfiguration axisConfiguration) {
-        this.axisConfiguration = axisConfiguration;
+    public void setConfigurationContext(ConfigurationContext configurationContext) {
+        this.configurationContext = configurationContext;
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
Wed Mar 21 04:55:38 2007
@@ -20,8 +20,6 @@
 
 import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.cluster.ClusteringFault;
-import org.apache.axis2.cluster.configuration.ConfigurationManagerListener;
-import org.apache.axis2.cluster.context.ContextManagerListener;
 import org.apache.axis2.cluster.listeners.DefaultContextManagerListener;
 import org.apache.axis2.clustering.configuration.TestConfigurationManagerListener;
 import org.apache.axis2.context.ConfigurationContext;
@@ -70,8 +68,8 @@
 		contextManagerListener2 = new DefaultContextManagerListener ();
 		clusterManager2.getContextManager(). addContextManagerListener (contextManagerListener2);

 
-		clusterManager1.getConfigurationManager().setAxisConfiguration(configurationContext1.getAxisConfiguration());
-		clusterManager2.getConfigurationManager().setAxisConfiguration(configurationContext2.getAxisConfiguration());
+		clusterManager1.getConfigurationManager().setConfigurationContext(configurationContext1.getAxisConfiguration());
+		clusterManager2.getConfigurationManager().setConfigurationContext(configurationContext2.getAxisConfiguration());
 		
 		configurationManagerListener1 = new TestConfigurationManagerListener ();
 		clusterManager1.getConfigurationManager().addConfigurationManagerListener(configurationManagerListener1);

Modified: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/TestConfigurationManagerListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/TestConfigurationManagerListener.java?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/TestConfigurationManagerListener.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/configuration/TestConfigurationManagerListener.java
Wed Mar 21 04:55:38 2007
@@ -16,62 +16,62 @@
 
 package org.apache.axis2.clustering.configuration;
 
-import java.util.ArrayList;
 import org.apache.axis2.cluster.configuration.ConfigurationEvent;
 import org.apache.axis2.cluster.configuration.ConfigurationManagerListener;
-import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContext;
+
+import java.util.ArrayList;
 
 public class TestConfigurationManagerListener implements ConfigurationManagerListener {
 
-	ArrayList eventList = null;
-	private AxisConfiguration axisConfiguration = null;
-	
-	public TestConfigurationManagerListener () {
-		eventList = new ArrayList ();
-	}
-	
-	public void handleException(Throwable throwable) {
-		// TODO Auto-generated method stub
-	}
-
-	public void clearEventList () {
-		eventList.clear();
-	}
-	
-	public ArrayList getEventList() {
-		return eventList;
-	}
-
-	public void commitCalled(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void configurationReloaded(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void policyApplied(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void prepareCalled(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void rollbackCalled(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void serviceGroupLoaded(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void serviceGroupUnloaded(ConfigurationEvent event) {
-		eventList.add(event);
-	}
-
-	public void setAxisConfiguration(AxisConfiguration axisConfiguration) {
-		this.axisConfiguration = axisConfiguration;
-	}
-	
+    ArrayList eventList = null;
+    private ConfigurationContext configurationContext = null;
+
+    public TestConfigurationManagerListener() {
+        eventList = new ArrayList();
+    }
+
+    public void handleException(Throwable throwable) {
+        // TODO Auto-generated method stub
+    }
+
+    public void clearEventList() {
+        eventList.clear();
+    }
+
+    public ArrayList getEventList() {
+        return eventList;
+    }
+
+    public void commitCalled(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void configurationReloaded(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void policyApplied(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void prepareCalled(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void rollbackCalled(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void serviceGroupLoaded(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void serviceGroupUnloaded(ConfigurationEvent event) {
+        eventList.add(event);
+    }
+
+    public void setConfigurationContext(ConfigurationContext configurationContext) {
+        this.configurationContext = configurationContext;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManager.java?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManager.java
Wed Mar 21 04:55:38 2007
@@ -18,6 +18,7 @@
 
 import org.apache.axis2.cluster.ClusteringFault;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.neethi.Policy;
 
 public interface ConfigurationManager {
@@ -55,5 +56,5 @@
      */
     void addConfigurationManagerListener(ConfigurationManagerListener listener);
 
-    void setAxisConfiguration(AxisConfiguration axisConfiguration);
+    void setConfigurationContext(ConfigurationContext configurationContext);
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManagerListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManagerListener.java?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManagerListener.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/cluster/configuration/ConfigurationManagerListener.java
Wed Mar 21 04:55:38 2007
@@ -17,6 +17,7 @@
 package org.apache.axis2.cluster.configuration;
 
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.context.ConfigurationContext;
 
 public interface ConfigurationManagerListener {
     void serviceGroupLoaded(ConfigurationEvent event);
@@ -27,5 +28,5 @@
     void rollbackCalled (ConfigurationEvent event);
     void commitCalled (ConfigurationEvent event);
     void handleException(Throwable throwable);
-    void setAxisConfiguration (AxisConfiguration axisConfiguration);
+    void setConfigurationContext (ConfigurationContext configurationContext);
 }

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?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- 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
Wed Mar 21 04:55:38 2007
@@ -22,6 +22,7 @@
 import org.apache.axis2.Constants;
 import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.cluster.ClusteringConstants;
+import org.apache.axis2.cluster.configuration.ConfigurationManager;
 import org.apache.axis2.cluster.context.ContextManager;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -36,12 +37,7 @@
 
 import java.io.File;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
+import java.util.*;
 
 /**
  * This contains all the configuration information for Axis2.
@@ -89,23 +85,29 @@
 
     public void initCluster() throws AxisFault {
         ClusterManager clusterManager = axisConfiguration.getClusterManager();
-        if (clusterManager!=null) {
-        	ContextManager contextManager = clusterManager.getContextManager();
-        	if (contextManager!=null)
-        		contextManager.setConfigurationContext(this);
-        }
-        
-        if (shouldClusterBeInitiated(clusterManager))
-        	clusterManager.init(this);
-    }
-    
-    private static boolean shouldClusterBeInitiated (ClusterManager clusterManager) {
-    	Parameter param = clusterManager.getParameter(ClusteringConstants.AVOID_INITIATION_KEY);
-    	if (param!=null && JavaUtils.isTrueExplicitly(param.getValue()))
-    		return false;
-    	else 
-    		return true;
-    }	
+        if (clusterManager != null) {
+            ContextManager contextManager = clusterManager.getContextManager();
+            if (contextManager != null) {
+                contextManager.setConfigurationContext(this);
+            }
+            ConfigurationManager configManager = clusterManager.getConfigurationManager();
+            if (configManager != null) {
+                configManager.setConfigurationContext(this);
+            }
+            if (shouldClusterBeInitiated(clusterManager)) {
+                clusterManager.init(this);
+            }
+        }
+    }
+
+    private static boolean shouldClusterBeInitiated(ClusterManager clusterManager) {
+        Parameter param = clusterManager.getParameter(ClusteringConstants.AVOID_INITIATION_KEY);
+        if (param != null && JavaUtils.isTrueExplicitly(param.getValue())) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 
     protected void finalize() throws Throwable {
         super.finalize();
@@ -156,9 +158,10 @@
 
                     ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
                     if (clusterManager != null) {
-                    	ContextManager contextManager = clusterManager.getContextManager();
-                    	if (contextManager!=null)
-                    		contextManager.addContext(serviceGroupContext);
+                        ContextManager contextManager = clusterManager.getContextManager();
+                        if (contextManager != null) {
+                            contextManager.addContext(serviceGroupContext);
+                        }
                     }
                 }
                 messageContext.setServiceGroupContext(serviceGroupContext);
@@ -171,7 +174,7 @@
                             serviceGroupContextId, messageContext);
                     if (serviceGroupContext == null) {
                         throw new AxisFault("Unable to find corresponding context" +
-                                " for the serviceGroupId: " + serviceGroupContextId);
+                                            " for the serviceGroupId: " + serviceGroupContextId);
                     }
                 } else {
                     AxisServiceGroup axisServiceGroup = (AxisServiceGroup) axisService.getParent();
@@ -185,9 +188,10 @@
 
                     ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
                     if (clusterManager != null) {
-                    	ContextManager contextManager = clusterManager.getContextManager();
-                    	if (contextManager!=null)
-                    		contextManager.addContext(serviceGroupContext);
+                        ContextManager contextManager = clusterManager.getContextManager();
+                        if (contextManager != null) {
+                            contextManager.addContext(serviceGroupContext);
+                        }
                     }
 
                     messageContext.setServiceGroupContextId(serviceGroupContextId);
@@ -317,7 +321,7 @@
                     {
                         if ((valueServiceName != null) && (valueServiceName.equals(serviceName)))
{
                             if ((valueServiceGroupName != null) && (serviceGroupName
!= null)
-                                    && (valueServiceGroupName.equals(serviceGroupName)))
{
+                                && (valueServiceGroupName.equals(serviceGroupName)))
{
                                 // match
                                 return value;
                             }
@@ -444,7 +448,7 @@
             ServiceGroupContext serviceGroupContext =
                     (ServiceGroupContext) serviceGroupContextMap.get(sgCtxtId);
             if ((currentTime - serviceGroupContext.getLastTouchedTime()) >
-                    getServiceGroupContextTimoutInterval()) {
+                getServiceGroupContextTimoutInterval()) {
                 sgCtxtMapKeyIter.remove();
                 cleanupServiceContexts(serviceGroupContext);
             }
@@ -475,7 +479,7 @@
 
     public void cleanupContexts() {
         if ((applicationSessionServiceGroupContextTable != null) &&
-                (applicationSessionServiceGroupContextTable.size() > 0)) {
+            (applicationSessionServiceGroupContextTable.size() > 0)) {
             Iterator applicationScopeSgs =
                     applicationSessionServiceGroupContextTable.values().iterator();
             while (applicationScopeSgs.hasNext()) {

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?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- 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
Wed Mar 21 04:55:38 2007
@@ -18,14 +18,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
-import org.apache.axis2.cluster.ClusterManager;
-import org.apache.axis2.cluster.ClusteringConstants;
-import org.apache.axis2.deployment.AxisConfigBuilder;
-import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.FileSystemConfigurator;
-import org.apache.axis2.deployment.URLBasedAxisConfigurator;
+import org.apache.axis2.deployment.*;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -37,7 +30,6 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.modules.Module;
 import org.apache.axis2.transport.TransportSender;
-import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.util.SessionUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

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?view=diff&rev=520848&r1=520847&r2=520848
==============================================================================
--- 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
Wed Mar 21 04:55:38 2007
@@ -19,17 +19,13 @@
 
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
 import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.cluster.configuration.ConfigurationManager;
 import org.apache.axis2.cluster.configuration.ConfigurationManagerListener;
 import org.apache.axis2.cluster.context.ContextManager;
 import org.apache.axis2.cluster.context.ContextManagerListener;
-import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.i18n.Messages;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 import javax.xml.namespace.QName;
 import java.io.InputStream;
@@ -41,8 +37,7 @@
  */
 public class ClusterBuilder extends DescriptionBuilder {
 
-	private static final Log log = LogFactory.getLog(ClusterBuilder.class);
-    private AxisService service;
+//	private static final Log log = LogFactory.getLog(ClusterBuilder.class);
 
     public ClusterBuilder(AxisConfiguration axisConfig) {
         this.axisConfig = axisConfig;
@@ -105,13 +100,13 @@
 						clazz = Class.forName(className);
 						ConfigurationManagerListener listener = (ConfigurationManagerListener) clazz
 								.newInstance();
-						listener.setAxisConfiguration(axisConfig);
+						listener.setConfigurationContext(configCtx);
 						configurationManager.addConfigurationManagerListener(listener);
 					}
 				}
 
-				//updating the ConfigurationManager with the new Axisconfiguration
-				configurationManager.setAxisConfiguration(axisConfig);
+				//updating the ConfigurationManager with the new ConfigurationContext
+				configurationManager.setConfigurationContext(configCtx);
 			}
 
 			
@@ -152,7 +147,6 @@
 			}
             
             axisConfig.setClusterManager(clusterManager);
-            return;
         } catch (ClassNotFoundException e) {
             throw new DeploymentException(Messages.getMessage("clusterImplNotFound"));
         } catch (InstantiationException e) {
@@ -162,5 +156,4 @@
             throw new DeploymentException(e);
         }
     }
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message