Author: dkulp
Date: Thu Sep 1 19:40:39 2011
New Revision: 1164229
URL: http://svn.apache.org/viewvc?rev=1164229&view=rev
Log:
Merged revisions 1164220 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1164220 | dkulp | 2011-09-01 15:22:20 -0400 (Thu, 01 Sep 2011) | 2 lines
[CXF-3742, CXF-3785] Fixes for having the lifecycle listeners called too
many times with spring/osgi
........
Modified:
cxf/branches/2.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java?rev=1164229&r1=1164228&r2=1164229&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
(original)
+++
cxf/branches/2.4.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
Thu Sep 1 19:40:39 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/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java?rev=1164229&r1=1164228&r2=1164229&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/JaxWsProxyFactoryBeanDefinitionParser.java
Thu Sep 1 19:40:39 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/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java?rev=1164229&r1=1164228&r2=1164229&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/spring/ClientProxyFactoryBeanDefinitionParser.java
Thu Sep 1 19:40:39 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;
}
}
}