cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1164220 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/ rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/
Date Thu, 01 Sep 2011 19:22:21 GMT
Author: dkulp
Date: Thu Sep  1 19:22:20 2011
New Revision: 1164220

URL: http://svn.apache.org/viewvc?rev=1164220&view=rev
Log:
[CXF-3742, CXF-3785] Fixes for having the lifecycle listeners called too
many times with spring/osgi

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java?rev=1164220&r1=1164219&r2=1164220&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
Thu Sep  1 19:22:20 2011
@@ -42,6 +42,10 @@ public abstract class AbstractFactoryBea
         factoriesAreAbstract = b;
     }
     
+    protected String getDestroyMethod() {
+        return null;
+    }
+    
     @SuppressWarnings("deprecation")
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
@@ -131,6 +135,9 @@ public abstract class AbstractFactoryBea
             bean.getBeanDefinition().setAttribute("id", id);
             bean.setFactoryBean(factoryId, "create");
         }
+        if (getDestroyMethod() != null) {
+            bean.setDestroyMethodName(getDestroyMethod());
+        }
     }
 
     protected abstract Class getFactoryClass();

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java?rev=1164220&r1=1164219&r2=1164220&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
Thu Sep  1 19:22:20 2011
@@ -90,6 +90,8 @@ public class JaxWsProxyFactoryBeanDefini
         public boolean isSingleton() {
             return true;
         }
+        
+
         public void destroy() throws Exception {
             if (obj != null) {
                 if (obj instanceof Closeable) {
@@ -98,6 +100,7 @@ public class JaxWsProxyFactoryBeanDefini
                     Client c = ClientProxy.getClient(obj);
                     c.destroy();
                 }
+                obj = null;
             }
         }
     }

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java?rev=1164220&r1=1164219&r2=1164220&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
Thu Sep  1 19:22:20 2011
@@ -65,7 +65,7 @@ public class ClientProxyFactoryBeanDefin
     protected String getSuffix() {
         return ".simple-client";
     }
-
+    
     @Override
     protected void mapAttribute(BeanDefinitionBuilder bean, Element e, String name, String
val) {
         if ("endpointName".equals(name) || "serviceName".equals(name)) {
@@ -127,6 +127,7 @@ public class ClientProxyFactoryBeanDefin
         public boolean isSingleton() {
             return true;
         }
+        
         public void destroy() throws Exception {
             if (obj != null) {
                 if (obj instanceof Closeable) {
@@ -135,6 +136,7 @@ public class ClientProxyFactoryBeanDefin
                     Client c = ClientProxy.getClient(obj);
                     c.destroy();
                 }
+                obj = null;
             }
         }
     }



Mime
View raw message