Author: asoldano
Date: 2014-01-30 12:50:25 -0500 (Thu, 30 Jan 2014)
New Revision: 18297
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
Revisit AbstractServerConfig.getServerIntegrationServerConfig() and use [JBWS-3755]
mechanism for knowing when to set the static reference
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2014-01-30
17:37:40 UTC (rev 18296)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2014-01-30
17:50:25 UTC (rev 18297)
@@ -35,7 +35,6 @@
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.management.CommonConfigStore;
import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.management.StackConfig;
import org.jboss.wsf.spi.management.StackConfigFactory;
import org.jboss.wsf.spi.management.WebServerInfo;
@@ -85,7 +84,7 @@
protected final CommonConfigStore<EndpointConfig> endpointConfigStore = new
CommonConfigStoreImpl<EndpointConfig>();
// The server integration classloader' ServerConfig instance reference
- private static ServerConfig serverConfig;
+ private static volatile ServerConfig serverConfig;
public MBeanServer getMbeanServer()
{
@@ -270,11 +269,8 @@
clientConfigStore.reload();
endpointConfigStore.reload();
- //cleanup the server integration classloader' service config reference as
- //a new server config can be created due to a server reload.
- synchronized (AbstractServerConfig.class) //synchronization to ensure visibility
- {
- serverConfig = null;
+ if (ClassLoaderProvider.isSet()) {
+ serverConfig = this;
}
}
@@ -294,15 +290,7 @@
if (!ClassLoaderProvider.isSet()) {
return null;
}
- synchronized (AbstractServerConfig.class) //ensure both atomicity and visibility
- {
- if (serverConfig == null)
- {
- final ClassLoader cl =
ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
- serverConfig = SPIProvider.getInstance().getSPI(ServerConfigFactory.class,
cl).getServerConfig();
- }
- return serverConfig;
- }
+ return serverConfig;
}
public String getImplementationTitle()
Show replies by date