Author: jim.ma
Date: 2010-04-28 10:13:26 -0400 (Wed, 28 Apr 2010)
New Revision: 12121
Modified:
stack/cxf/branches/jms-integration/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/CXFEndpointsDeployment.java
stack/cxf/branches/jms-integration/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
stack/cxf/branches/jms-integration/pom.xml
Log:
[JBWS-2791]:Explicitly to close the created jms connection;updated the spring to 2.5.6
Modified:
stack/cxf/branches/jms-integration/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/CXFEndpointsDeployment.java
===================================================================
---
stack/cxf/branches/jms-integration/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/CXFEndpointsDeployment.java 2010-04-27
05:44:25 UTC (rev 12120)
+++
stack/cxf/branches/jms-integration/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/CXFEndpointsDeployment.java 2010-04-28
14:13:26 UTC (rev 12121)
@@ -25,6 +25,10 @@
import java.util.List;
import org.apache.cxf.BusFactory;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.endpoint.ServerRegistry;
+import org.apache.cxf.transport.jms.JMSConfiguration;
+import org.apache.cxf.transport.jms.JMSDestination;
import org.jboss.wsf.common.integration.WSHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -38,6 +42,7 @@
import org.jboss.wsf.spi.metadata.endpoints.jms.JMSAddressMetaData;
import org.jboss.wsf.spi.metadata.endpoints.jms.JMSDestinationMetaData;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
+import org.springframework.jms.connection.SingleConnectionFactory;
/**
* The pojo bean to deploy the jbossws-endpoints.xml to cxf stack
@@ -46,7 +51,7 @@
*/
public class CXFEndpointsDeployment extends AbstractEndpointsDeployment
{
-
+
private EndpointRegistry registry;
private BusHolder busHolder = null;
@@ -83,11 +88,44 @@
}
@Override
- public void stop() throws Exception
+ public void stop() throws Exception
{
log.debug("Undeploying jbossws-endpoints.xml in " +
this.getDeployment().getSimpleName());
if (busHolder != null & busHolder.getBus() != null)
- {
+ {
+ //CXF uses WrappedConnectionFactory to create "jmsLietener".
DefaultMessageListenerContainer.shutdown() can not colse all the jms connections.
+ //We need to explicitly call detroy() to close connection. This should be fixed
in CXF side.
+ SingleConnectionFactory connectionFactory = null;
+ Server jmsServer = null;
+ ServerRegistry serRegistry =
busHolder.getBus().getExtension(ServerRegistry.class);
+ for (Server server : serRegistry.getServers())
+ {
+ if (server.getDestination() != null && server.getDestination()
instanceof JMSDestination)
+ {
+ JMSDestination jmsDestination = (JMSDestination) server.getDestination();
+ JMSConfiguration jmsConfig = jmsDestination.getJmsConfig();
+ if (jmsConfig.getWrappedConnectionFactory() != null
+ && jmsConfig.getWrappedConnectionFactory() instanceof
SingleConnectionFactory)
+ {
+ connectionFactory = (SingleConnectionFactory) jmsConfig
+ .getWrappedConnectionFactory();
+ jmsServer = server;
+ }
+
+ }
+
+ }
+
+ if (jmsServer != null)
+ {
+ jmsServer.stop();
+ }
+
+ if (connectionFactory != null)
+ {
+ connectionFactory.destroy();
+ }
+ //TODO:Remove above code after CXF fix this issue
//close LifecycleListener if exists
busHolder.getBus().shutdown(false);
busHolder.close();
Modified:
stack/cxf/branches/jms-integration/modules/server/src/main/resources/jbossws-cxf-config-as6.xml
===================================================================
---
stack/cxf/branches/jms-integration/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-04-27
05:44:25 UTC (rev 12120)
+++
stack/cxf/branches/jms-integration/modules/server/src/main/resources/jbossws-cxf-config-as6.xml 2010-04-28
14:13:26 UTC (rev 12121)
@@ -45,6 +45,14 @@
<property
name="invokerJSE">org.jboss.wsf.stack.cxf.InvokerJSE</property>
<property name="forJaxRpc">false</property>
</bean>
+
+ <bean name="EndpointsDescriptorDeploymentAspect"
class="org.jboss.wsf.stack.cxf.deployment.aspect.EndpointsDescriptorDeploymentAspect">
+ <property
name="requires">EndpointAddress,JAXBIntros</property>
+ <property name="provides">StackDescriptor</property>
+ <property name="relativeOrder">22</property> <!--
[JBDEPLOY-201] workaround -->
+ <property name="forJaxRpc">false</property>
+ </bean>
+
<bean name="WSCXFResourceResolverDeploymentAspect"
class="org.jboss.wsf.stack.cxf.deployment.aspect.ResourceResolverDeploymentAspect">
<property name="requires">JmsEndpointAddress</property>
Modified: stack/cxf/branches/jms-integration/pom.xml
===================================================================
--- stack/cxf/branches/jms-integration/pom.xml 2010-04-27 05:44:25 UTC (rev 12120)
+++ stack/cxf/branches/jms-integration/pom.xml 2010-04-28 14:13:26 UTC (rev 12121)
@@ -76,7 +76,7 @@
<velocity.version>1.5</velocity.version>
<xmlsec.version>1.4.3</xmlsec.version>
<wstx.version>3.2.9</wstx.version>
- <spring.version>2.5.5</spring.version>
+ <spring.version>2.5.6</spring.version>
</properties>
Show replies by date