cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1088304 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/bus/extension/ core/src/main/java/org/apache/cxf/bus/spring/ core/src/main/java/org/apache/cxf/transport/ transports/http-jetty/src/main/resources/META-INF/cxf/ transports/http/...
Date Sun, 03 Apr 2011 13:54:53 GMT
Author: dkulp
Date: Sun Apr  3 13:54:53 2011
New Revision: 1088304

URL: http://svn.apache.org/viewvc?rev=1088304&view=rev
Log:
Restore some behavior/methods to maintain some compatibility with
previous CXF versions and other users of CXF like Camel

Added:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties   (with
props)
Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/TransportFinder.java
    cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
    cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
Sun Apr  3 13:54:53 2011
@@ -125,7 +125,8 @@ public class ExtensionManagerBus extends
         }
         extensionManager.load(new String[] {
             ExtensionManagerImpl.BUS_EXTENSION_RESOURCE,
-            ExtensionManagerImpl.BUS_EXTENSION_RESOURCE_XML});
+            ExtensionManagerImpl.BUS_EXTENSION_RESOURCE_XML,
+            ExtensionManagerImpl.BUS_EXTENSION_RESOURCE_OLD_XML});
         
         extensionManager.activateAllByType(ResourceResolver.class);
         

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
Sun Apr  3 13:54:53 2011
@@ -29,9 +29,12 @@ import java.util.LinkedHashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.ResourceInjector;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.ConfiguredBeanLocator;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.resource.ObjectTypeResolver;
@@ -40,11 +43,14 @@ import org.apache.cxf.resource.ResourceR
 import org.apache.cxf.resource.SinglePropertyResolver;
 
 public class ExtensionManagerImpl implements ExtensionManager, ConfiguredBeanLocator {
-
+    public static final Logger LOG = LogUtils.getL7dLogger(ExtensionManagerImpl.class);
+    
+    
     public static final String EXTENSIONMANAGER_PROPERTY_NAME = "extensionManager";
     public static final String ACTIVATION_NAMESPACES_PROPERTY_NAME = "activationNamespaces";
     public static final String ACTIVATION_NAMESPACES_SETTER_METHOD_NAME = "setActivationNamespaces";
     public static final String BUS_EXTENSION_RESOURCE_XML = "META-INF/cxf/bus-extensions.xml";
+    public static final String BUS_EXTENSION_RESOURCE_OLD_XML = "bus-extensions.xml";
     public static final String BUS_EXTENSION_RESOURCE = "META-INF/cxf/bus-extensions.txt";
     
     private final ClassLoader loader;
@@ -55,7 +61,8 @@ public class ExtensionManagerImpl implem
 
     public ExtensionManagerImpl(ClassLoader cl, Map<Class, Object> initialExtensions,

                                 ResourceManager rm, Bus b) {
-        this(new String[] {BUS_EXTENSION_RESOURCE, BUS_EXTENSION_RESOURCE_XML},
+        this(new String[] {BUS_EXTENSION_RESOURCE, BUS_EXTENSION_RESOURCE_XML,
+                           BUS_EXTENSION_RESOURCE_OLD_XML},
                  cl, initialExtensions, rm, b);
     }
     public ExtensionManagerImpl(String resource, 
@@ -132,10 +139,11 @@ public class ExtensionManagerImpl implem
         Enumeration<URL> urls = loader.getResources(resource);
         while (urls.hasMoreElements()) {
             URL url = urls.nextElement();
-            
             InputStream is = url.openStream();
             List<Extension> exts;
             if (resource.endsWith("xml")) {
+                LOG.log(Level.WARNING, "DEPRECATED_EXTENSIONS", 
+                        new Object[] {resource, url, BUS_EXTENSION_RESOURCE});
                 exts = new ExtensionFragmentParser().getExtensionsFromXML(is);
             } else {
                 exts = new ExtensionFragmentParser().getExtensionsFromText(is);

Added: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties?rev=1088304&view=auto
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties (added)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties Sun Apr
 3 13:54:53 2011
@@ -0,0 +1,21 @@
+#
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+#
+#
+DEPRECATED_EXTENSIONS = Loading Bus extensions via {0} (found url {1}) is deprecated.  Use
{2} instead.

Propchange: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/Messages.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
Sun Apr  3 13:54:53 2011
@@ -62,7 +62,10 @@ public class BusExtensionPostProcessor i
         if (bus == null) {
             bus = (Bus)context.getBean(Bus.DEFAULT_BUS_ID);
             bus.setExtension(context, ApplicationContext.class);
-            bus.setExtension(new SpringBeanLocator(context, bus), ConfiguredBeanLocator.class);
+            ConfiguredBeanLocator loc = bus.getExtension(ConfiguredBeanLocator.class);
+            if (!(loc instanceof SpringBeanLocator)) {
+                bus.setExtension(new SpringBeanLocator(context, bus), ConfiguredBeanLocator.class);
+            }
         }
         return bus;
     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/BusWiringBeanFactoryPostProcessor.java
Sun Apr  3 13:54:53 2011
@@ -24,8 +24,11 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.NullConfigurer;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.configuration.spring.BusWiringType;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
 import org.apache.cxf.helpers.CastUtils;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.config.BeanDefinition;
@@ -144,6 +147,20 @@ public class BusWiringBeanFactoryPostPro
         constructorArgs.addIndexedArgumentValue(0, valueToInsert);
     }
     
+    public static void updateBusReferencesInContext(Bus bus, ApplicationContext ctx) {
+        Configurer conf = bus.getExtension(Configurer.class);
+        if (conf instanceof NullConfigurer) {
+            bus.setExtension(new ConfigurerImpl(ctx), Configurer.class);
+            conf = bus.getExtension(Configurer.class);
+        } else if (conf instanceof ConfigurerImpl) {
+            ((ConfigurerImpl)conf).addApplicationContext(ctx);
+        }
+        if (ctx instanceof ConfigurableApplicationContext) {
+            ConfigurableApplicationContext cctx = (ConfigurableApplicationContext)ctx;
+            new BusWiringBeanFactoryPostProcessor(bus).postProcessBeanFactory(cctx.getBeanFactory());
+        }
+    }
+
     public static Bus addDefaultBus(ApplicationContext ctx) {
         if (!ctx.containsBean(Bus.DEFAULT_BUS_ID)) {
             Bus b = getBusForName(Bus.DEFAULT_BUS_ID, ctx);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/TransportFinder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/TransportFinder.java?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/TransportFinder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/transport/TransportFinder.java Sun Apr
 3 13:54:53 2011
@@ -139,11 +139,13 @@ public class TransportFinder<T> {
     }
 
     private void registerBean(T bean) {
-        if (bean instanceof AbstractTransportFactory) {
-            for (String ns 
-                 : ((AbstractTransportFactory)bean).getTransportIds()) {
-                if (!map.containsKey(ns)) {
-                    map.put(ns, bean);
+        if (bean instanceof AbstractTransportFactory) { 
+            if (((AbstractTransportFactory)bean).getTransportIds() != null) {
+                for (String ns 
+                    : ((AbstractTransportFactory)bean).getTransportIds()) {
+                    if (!map.containsKey(ns)) {
+                        map.put(ns, bean);
+                    }
                 }
             }
         } else {

Modified: cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/cxf/cxf-extension-http-jetty.xml
Sun Apr  3 13:54:53 2011
@@ -27,7 +27,7 @@ http://www.springframework.org/schema/be
     <bean id="org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory"
        class="org.apache.cxf.bus.spring.OldSpringSupport" lazy-init="true">
         <constructor-arg ref="cxf"/>
-        <constructor-arg value="org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory"/>
+        <constructor-arg value="org.apache.cxf.transport.http_jetty.JettyDestinationFactory"/>
         <constructor-arg value="cxf-extension-http-jetty.xml"/>
     </bean>
 

Modified: cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml?rev=1088304&r1=1088303&r2=1088304&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml (original)
+++ cxf/trunk/rt/transports/http/src/main/resources/META-INF/cxf/cxf-extension-http.xml Sun
Apr  3 13:54:53 2011
@@ -26,7 +26,7 @@ http://www.springframework.org/schema/be
     <bean id="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory"
 	  class="org.apache.cxf.bus.spring.OldSpringSupport" lazy-init="true">
         <constructor-arg ref="cxf"/>
-        <constructor-arg value="org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory"/>
+        <constructor-arg value="org.apache.cxf.transport.http.HTTPTransportFactory"/>
         <constructor-arg value="cxf-extension-http.xml"/>
     </bean>
     



Mime
View raw message