axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r595293 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
Date Thu, 15 Nov 2007 12:47:15 GMT
Author: scheu
Date: Thu Nov 15 04:47:15 2007
New Revision: 595293

URL: http://svn.apache.org/viewvc?rev=595293&view=rev
Log:
AXIS2-3344
Contributor:Rich Scheuerle
Performance Analysis: David Strite
Reduce the synchronization block in addPropertyDifference

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/AbstractContext.java

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=595293&r1=595292&r2=595293&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
Thu Nov 15 04:47:15 2007
@@ -153,15 +153,21 @@
         addPropertyDifference(key);
     }
 
-    private synchronized void addPropertyDifference(String key) {
+    private void addPropertyDifference(String key) {
         ConfigurationContext cc = getRootContext();
-        if (cc == null) return;
-
+        if (cc == null) {
+            return;
+        }
         // 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) {
+        if (clusterManager == null ||
+            clusterManager.getContextManager() == null) {
+            return;
+        }
+        // Narrowed the synchronization so that we only wait
+        // if a property difference is added.
+        synchronized(this) {
             propertyDifferences.put(key, new PropertyDifference(key, false));
         }
     }



---------------------------------------------------------------------
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