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 sc...@apache.org on 2009/06/18 17:31:54 UTC
svn commit: r786126 -
/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
Author: scheu
Date: Thu Jun 18 15:31:53 2009
New Revision: 786126
URL: http://svn.apache.org/viewvc?rev=786126&view=rev
Log:
JIRA:AXIS2-4391
Contributor:Jeff Barrett
Committer:Rich Scheuerle
Summary:
Minor synchronization added to EndpointDescriptionImpl to avoid the situation where to service clients
use the same AxisService name.
Modified:
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?rev=786126&r1=786125&r2=786126&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Thu Jun 18 15:31:53 2009
@@ -1163,13 +1163,20 @@
ConfigurationContext configCtx = getServiceDescription().getAxisConfigContext();
AxisService axisSvc = getAxisService();
AxisConfiguration axisCfg = configCtx.getAxisConfiguration();
- if (axisCfg.getService(axisSvc.getName()) != null) {
- axisSvc.setName(axisSvc.getName() + uniqueID());
- if (log.isDebugEnabled()) {
- log.debug("AxisService name is now " + axisSvc.getName() + ". This name should be unique; if not, errors might occur.");
+ // The method synchronization prevents more than 1 service client being created
+ // for the same EndpointDescription instance by multiple threads. We also need
+ // to prevent different EndpointDescription instances from creating service client
+ // instances using the same AxisService name under multiple threads. We do that by
+ // synchronizing on the AxisConfiguration instance.
+ synchronized(axisCfg) {
+ if (axisCfg.getService(axisSvc.getName()) != null) {
+ axisSvc.setName(axisSvc.getName() + uniqueID());
+ if (log.isDebugEnabled()) {
+ log.debug("AxisService name is now " + axisSvc.getName() + ". This name should be unique; if not, errors might occur.");
+ }
}
+ serviceClient = new ServiceClient(configCtx, axisSvc);
}
- serviceClient = new ServiceClient(configCtx, axisSvc);
}
} catch (AxisFault e) {
throw ExceptionFactory.makeWebServiceException(