cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r661777 - in /cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/configuration/spring/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/resources/META-INF/cxf/ rt/frontend/jaxws/src/main/java/org/apache...
Date Fri, 30 May 2008 16:06:10 GMT
Author: dkulp
Date: Fri May 30 09:06:10 2008
New Revision: 661777

URL: http://svn.apache.org/viewvc?rev=661777&view=rev
Log:
Merged revisions 661757 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r661757 | dkulp | 2008-05-30 11:21:39 -0400 (Fri, 30 May 2008) | 2 lines
  
  [CXF-1619] Patch from Ian Roberts applied.   Major thanks! 
........

Added:
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/BusWiringType.java
      - copied unchanged from r661757, cxf/trunk/common/common/src/main/java/org/apache/cxf/configuration/spring/BusWiringType.java
    cxf/branches/2.0.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
      - copied unchanged from r661757, cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
Modified:
    cxf/branches/2.0.x-fixes/   (props changed)
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
    cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
    cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
    cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/rmmanager.xml

Propchange: cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractBeanDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -20,6 +20,7 @@
 
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBElement;
@@ -33,6 +34,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.CacheMap;
 import org.apache.cxf.helpers.DOMUtils;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
@@ -46,14 +48,19 @@
 
 public abstract class AbstractBeanDefinitionParser 
     extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser {
+    public static final String WIRE_BUS_ATTRIBUTE = AbstractBeanDefinitionParser.class.getName()
+ ".wireBus";
+
     private static Map<String, JAXBContext> packageContextCache = new CacheMap<String,
JAXBContext>(); 
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(AbstractBeanDefinitionParser.class);
+    
     private Class beanClass;
     
     @Override
     protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
         boolean setBus = parseAttributes(element, ctx, bean);        
-        if (!setBus && ctx.getRegistry().containsBeanDefinition("cxf") &&
hasBusProperty()) {
-            wireBus(bean, "cxf");
+        if (!setBus && hasBusProperty()) {
+            addBusWiringAttribute(bean, BusWiringType.PROPERTY);
         }
         parseChildElements(element, ctx, bean);
     }
@@ -219,8 +226,9 @@
         return first;
     }
 
-    protected void wireBus(BeanDefinitionBuilder bean, String busId) {
-        bean.addPropertyReference("bus", busId);
+    protected void addBusWiringAttribute(BeanDefinitionBuilder bean, BusWiringType type)
{
+        LOG.fine("Adding " + WIRE_BUS_ATTRIBUTE + " attribute " + type + " to bean " + bean);
+        bean.getRawBeanDefinition().setAttribute(WIRE_BUS_ATTRIBUTE, type);
     }
     
     protected void mapElementToJaxbProperty(Element parent, 

Modified: cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/configuration/spring/AbstractFactoryBeanDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -62,8 +62,8 @@
             } 
         }
         
-        if (!setBus && ctx.getRegistry().containsBeanDefinition("cxf")) {
-            wireBus(factoryBean, "cxf");
+        if (!setBus) {
+            addBusWiringAttribute(factoryBean, BusWiringType.PROPERTY);
         }
         
         NodeList children = element.getChildNodes();

Modified: cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml (original)
+++ cxf/branches/2.0.x-fixes/rt/core/src/main/resources/META-INF/cxf/cxf.xml Fri May 30 09:06:10
2008
@@ -24,8 +24,9 @@
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
     <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl"/>
-    <bean class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor" id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>
   
-    <bean class="org.apache.cxf.bus.spring.BusExtensionPostProcessor" id="org.apache.cxf.bus.spring.BusExtensionPostProcessor"/>
+    <bean id="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor" class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"/>
+    <bean id="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor" class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>
   
+    <bean id="org.apache.cxf.bus.spring.BusExtensionPostProcessor" class="org.apache.cxf.bus.spring.BusExtensionPostProcessor"/>
     
     <bean id="org.apache.cxf.resource.ResourceManager" class="org.apache.cxf.bus.resource.ResourceManagerImpl">
        <constructor-arg>

Modified: cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/spring/EndpointDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -29,10 +29,10 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.apache.cxf.Bus;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.springframework.beans.FatalBeanException;
 import org.springframework.beans.factory.BeanDefinitionStoreException;
@@ -61,13 +61,9 @@
         NamedNodeMap atts = element.getAttributes();
         String bus = element.getAttribute("bus");
         if (StringUtils.isEmpty(bus)) {
-            if (ctx.getRegistry().containsBeanDefinition(Bus.DEFAULT_BUS_ID)) {
-                bean.addConstructorArgReference(Bus.DEFAULT_BUS_ID);
-            }
+            addBusWiringAttribute(bean, BusWiringType.CONSTRUCTOR);
         } else {
-            if (ctx.getRegistry().containsBeanDefinition(bus)) {
-                bean.addConstructorArgReference(bus);
-            }
+            bean.addConstructorArgReference(bus);
         }
         for (int i = 0; i < atts.getLength(); i++) {
             Attr node = (Attr) atts.item(i);

Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineBeanDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -30,6 +30,7 @@
 import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
 import org.apache.cxf.configuration.security.TLSServerParametersType;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine;
 import org.apache.cxf.transport.http_jetty.ThreadingParameters;
 import org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType;
@@ -114,7 +115,12 @@
             throw new RuntimeException("Could not process configuration.", e);
         }
         
-        bean.addPropertyValue("bus", busValue.getValue());        
+        // if the containing bean is having the bus wired up by the post processor then we
should too
+        if (ctx.getContainingBeanDefinition().getAttribute(WIRE_BUS_ATTRIBUTE) == BusWiringType.PROPERTY)
{
+            addBusWiringAttribute(bean, BusWiringType.PROPERTY);
+        } else {
+            bean.addPropertyValue("bus", busValue.getValue());
+        }
         
         bean.setLazyInit(false);
         

Modified: cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -33,6 +33,7 @@
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
 import org.apache.cxf.transport.http_jetty.ThreadingParameters;
 
@@ -73,9 +74,7 @@
             
             
             if (StringUtils.isEmpty(bus)) {
-                if (ctx.getRegistry().containsBeanDefinition("cxf")) {
-                    bean.addPropertyReference("bus", "cxf");
-                }
+                addBusWiringAttribute(bean, BusWiringType.PROPERTY);
             } else {
                 bean.addPropertyReference("bus", bus);
             }

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
(original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/spring/RMManagerBeanDefinitionParser.java
Fri May 30 09:06:10 2008
@@ -24,6 +24,7 @@
 import org.w3c.dom.Element;
 
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.configuration.spring.BusWiringType;
 import org.apache.cxf.ws.rm.RMManager;
 import org.apache.cxf.ws.rm.policy.RMAssertion;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
@@ -50,8 +51,8 @@
         ctx.getDelegate().parsePropertyElements(element, bean.getBeanDefinition());
         
         String bus = element.getAttribute("bus");
-        if (bus == null || "".equals(bus) && ctx.getRegistry().containsBeanDefinition("cxf"))
{
-            bean.addPropertyReference("bus", "cxf");
+        if (bus == null || "".equals(bus)) {
+            addBusWiringAttribute(bean, BusWiringType.PROPERTY);
         } else {
             bean.addPropertyReference("bus", bus);
         }

Modified: cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/rmmanager.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/rmmanager.xml?rev=661777&r1=661776&r2=661777&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/rmmanager.xml (original)
+++ cxf/branches/2.0.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/rmmanager.xml Fri
May 30 09:06:10 2008
@@ -27,6 +27,7 @@
         <property name="bus" ref="cxf"/>
     </bean>
     <bean class="org.apache.cxf.bus.spring.Jsr250BeanPostProcessor"/>
+    <bean class="org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor"/>
     <import resource="../../../../../META-INF/cxf/cxf-extension-rm.xml"/>  
     
 </beans>



Mime
View raw message