cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1422898 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Date Mon, 17 Dec 2012 12:26:13 GMT
Author: sergeyb
Date: Mon Dec 17 12:26:12 2012
New Revision: 1422898

URL: http://svn.apache.org/viewvc?rev=1422898&view=rev
Log:
[CXF-4702] Also adding an option to register all the providers in a list

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1422898&r1=1422897&r2=1422898&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Mon Dec 17 12:26:12 2012
@@ -102,6 +102,7 @@ public final class ProviderFactory {
     private static final String DEFAULT_FILTER_NAME_BINDING = "org.apache.cxf.filter.binding";
     private static final String JAXB_PROVIDER_NAME = "org.apache.cxf.jaxrs.provider.JAXBElementProvider";
     private static final String JSON_PROVIDER_NAME = "org.apache.cxf.jaxrs.provider.json.JSONProvider";
+    private static final String BUS_PROVIDERS_ALL = "org.apache.cxf.jaxrs.bus.providers";
     
     static {
         SHARED_FACTORY.setProviders(new BinaryDataProvider<Object>(),
@@ -683,13 +684,20 @@ public final class ProviderFactory {
         }
     }
     
+    
     private void addBusExtension(List<Object> extensions, Class<?>... extClasses)
{
         for (Class<?> extClass : extClasses) {
             Object ext = bus.getProperty(extClass.getName());
-            if (ext != null && extClass.isInstance(ext)) {
+            if (extClass.isInstance(ext)) {
                 extensions.add(ext);
             }
         }
+        Object allProp = bus.getProperty(BUS_PROVIDERS_ALL);
+        if (allProp instanceof List) {
+            @SuppressWarnings("unchecked")
+            List<Object> all = (List<Object>)allProp;
+            extensions.addAll(all);
+        }
     }
     
 //CHECKSTYLE:OFF       



Mime
View raw message