cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1041186 - in /cxf/branches/2.2.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Date Wed, 01 Dec 2010 21:55:25 GMT
Author: sergeyb
Date: Wed Dec  1 21:55:25 2010
New Revision: 1041186

URL: http://svn.apache.org/viewvc?rev=1041186&view=rev
Log:
Merged revisions 1041185 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes

................
  r1041185 | sergeyb | 2010-12-01 21:52:05 +0000 (Wed, 01 Dec 2010) | 9 lines
  
  Merged revisions 1041183 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1041183 | sergeyb | 2010-12-01 21:48:26 +0000 (Wed, 01 Dec 2010) | 1 line
    
    [CXF-3159] Catching late provider initialization exceptions
  ........
................

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/provider/ProviderFactory.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec  1 21:55:25 2010
@@ -0,0 +1,2 @@
+/cxf/branches/2.3.x-fixes:1041185
+/cxf/trunk:1041183

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/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1041186&r1=1041185&r2=1041186&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Wed Dec  1 21:55:25 2010
@@ -59,9 +59,9 @@ public final class ProviderFactory {
     private static final ProviderFactory SHARED_FACTORY = new ProviderFactory();
     
     static {
-        SHARED_FACTORY.setProviders(createProvider("org.apache.cxf.jaxrs.provider.JAXBElementProvider"),
-                                    createProvider("org.apache.cxf.jaxrs.provider.JSONProvider"),
-                                    new BinaryDataProvider(),
+        setDefaultProvider(SHARED_FACTORY, "org.apache.cxf.jaxrs.provider.JAXBElementProvider");
+        setDefaultProvider(SHARED_FACTORY, "org.apache.cxf.jaxrs.provider.JSONProvider");
       
+        SHARED_FACTORY.setProviders(new BinaryDataProvider(),
                                     new SourceProvider(),
                                     new FormEncodingProvider(),
                                     new PrimitiveTextProvider(),
@@ -91,11 +91,14 @@ public final class ProviderFactory {
     private ProviderFactory() {
     }
     
-    private static Object createProvider(String className) {
+    
+    private static void setDefaultProvider(ProviderFactory factory, String className) {
+        
         try {
-            return ClassLoaderUtils.loadClass(className, ProviderFactory.class).newInstance();
+            Object provider = ClassLoaderUtils.loadClass(className, ProviderFactory.class).newInstance();
+            factory.setProviders(provider);
         } catch (Throwable ex) {
-            String message = "Problem with instantiating the default provider " + className;
+            String message = "Problem with setting the default provider " + className;
             if (ex.getMessage() != null) {
                 message += ex.getMessage();
             } else {
@@ -103,7 +106,6 @@ public final class ProviderFactory {
             }
             LOG.info(message);
         }
-        return  null;
     }
     
     public static ProviderFactory getInstance() {



Mime
View raw message