Author: alessio.soldano(a)jboss.com
Date: 2008-03-19 10:50:48 -0400 (Wed, 19 Mar 2008)
New Revision: 6021
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
Log:
[JBWS-1992] saving endpoint registry as a parameter of the endpoint registry deployment
aspect and skipping JMX server unregister when the mbeanServer is not available
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2008-03-19
13:23:54 UTC (rev 6020)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2008-03-19
14:50:48 UTC (rev 6021)
@@ -37,10 +37,13 @@
*/
public class EndpointRegistryDeploymentAspect extends DeploymentAspect
{
+ private EndpointRegistry registry;
+
public void create(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- EndpointRegistry registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
+ if (registry == null)
+ registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
for (Endpoint ep : dep.getService().getEndpoints())
{
registry.register(ep);
@@ -50,8 +53,8 @@
public void destroy(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- EndpointRegistry registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
-
+ if (registry == null)
+ registry =
spiProvider.getSPI(EndpointRegistryFactory.class).getEndpointRegistry();
for (Endpoint ep : dep.getService().getEndpoints())
{
registry.unregister(ep);
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2008-03-19
13:23:54 UTC (rev 6020)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java 2008-03-19
14:50:48 UTC (rev 6021)
@@ -63,7 +63,7 @@
ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint, mbeanServer);
getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
}
- catch (JMException ex)
+ catch (Exception ex)
{
log.error("Cannot register endpoint with JMX server", ex);
}
@@ -75,7 +75,10 @@
super.unregister(endpoint);
try
{
- getMbeanServer().unregisterMBean(endpoint.getName());
+ if (getMbeanServer() != null)
+ getMbeanServer().unregisterMBean(endpoint.getName());
+ else
+ log.warn("MBeanServer not available, cannot unregister endpoint with JMX
server");
}
catch (JMException ex)
{