cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r984869 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
Date Thu, 12 Aug 2010 17:21:14 GMT
Author: dkulp
Date: Thu Aug 12 17:21:13 2010
New Revision: 984869

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

........
  r984862 | dkulp | 2010-08-12 12:50:47 -0400 (Thu, 12 Aug 2010) | 4 lines
  
  [CXF-2936] Change the registration of the JAXRS binding to be internal
  to the factory.  Reduces the spring stuff as well as makes it so
  it's NOT required to import the cxf-extension-jaxrs-binding.xml
  file.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml

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

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=984869&r1=984868&r2=984869&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Thu Aug 12 17:21:13 2010
@@ -31,6 +31,7 @@ import java.util.logging.Logger;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
 
+import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.binding.BindingConfiguration;
 import org.apache.cxf.binding.BindingFactory;
@@ -85,6 +86,29 @@ public class AbstractJAXRSFactoryBean ex
         setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
     }
     
+    public Bus getBus() {
+        Bus b = super.getBus();
+        checkBindingFactory(bus);
+        return b;
+    }
+
+    private void checkBindingFactory(Bus bus) {
+        BindingFactoryManager bfm = bus.getExtension(BindingFactoryManager.class);
+        try {
+            bfm.getBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID);
+        } catch (BusException b) {
+            //not registered, let's register one
+            JAXRSBindingFactory jbf = new JAXRSBindingFactory();
+            jbf.setBus(bus);
+            bfm.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, 
+                                       jbf);
+        }
+    }
+
+    public void setBus(Bus bus) {
+        super.setBus(bus);
+        checkBindingFactory(bus);
+    }
     
     /*
      * EndpointInfo contains information form WSDL's physical part such as

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml?rev=984869&r1=984868&r2=984869&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/resources/META-INF/cxf/cxf-extension-jaxrs-binding.xml
Thu Aug 12 17:21:13 2010
@@ -23,15 +23,7 @@
        xmlns:foo="http://cxf.apache.org/configuration/foo"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-    
-    <bean class="org.apache.cxf.jaxrs.JAXRSBindingFactory" 
-	  id="org.apache.cxf.jaxrs.JAXRSBindingFactory" 
-	  lazy-init="true">
-        <property name="activationNamespaces">
-            <set>
-                <value>http://apache.org/cxf/binding/jaxrs</value>
-            </set>
-        </property>
-	<property name="bus" ref="cxf"/>
-    </bean>
+
+    <!-- Nothing needed now.  Leave file for 2.2.x for compatibility -->
+
 </beans>



Mime
View raw message