Author: alessio.soldano(a)jboss.com
Date: 2012-01-31 05:17:15 -0500 (Tue, 31 Jan 2012)
New Revision: 15547
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java
Log:
[JBWS-3421] Do not cache EndpointRegistry instance
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java 2012-01-31
03:25:22 UTC (rev 15546)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRegistryDeploymentAspect.java 2012-01-31
10:17:15 UTC (rev 15547)
@@ -36,13 +36,15 @@
*/
public class EndpointRegistryDeploymentAspect extends AbstractDeploymentAspect
{
- private EndpointRegistry registry;
+ private EndpointRegistryFactory factory;
public void start(Deployment dep)
{
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- if (registry == null)
- registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ if (factory == null) {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ factory = spiProvider.getSPI(EndpointRegistryFactory.class);
+ }
+ EndpointRegistry registry = factory.getEndpointRegistry();
for (Endpoint ep : dep.getService().getEndpoints())
{
registry.register(ep);
@@ -51,9 +53,11 @@
public void stop(Deployment dep)
{
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- if (registry == null)
- registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ if (factory == null) {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ factory = spiProvider.getSPI(EndpointRegistryFactory.class);
+ }
+ EndpointRegistry registry = factory.getEndpointRegistry();
for (Endpoint ep : dep.getService().getEndpoints())
{
registry.unregister(ep);
Show replies by date