servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1389477 - in /servicemix/smx4/specs/trunk/saaj-api-1.3: pom.xml src/main/java/javax/xml/soap/FactoryFinder.java
Date Mon, 24 Sep 2012 16:38:10 GMT
Author: dkulp
Date: Mon Sep 24 16:38:10 2012
New Revision: 1389477

URL: http://svn.apache.org/viewvc?rev=1389477&view=rev
Log:
[SMX4-1248] Update saaj-api specs bundle to latest geronimo-specs version

Modified:
    servicemix/smx4/specs/trunk/saaj-api-1.3/pom.xml
    servicemix/smx4/specs/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java

Modified: servicemix/smx4/specs/trunk/saaj-api-1.3/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/saaj-api-1.3/pom.xml?rev=1389477&r1=1389476&r2=1389477&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/saaj-api-1.3/pom.xml (original)
+++ servicemix/smx4/specs/trunk/saaj-api-1.3/pom.xml Mon Sep 24 16:38:10 2012
@@ -37,7 +37,7 @@
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-saaj_1.3_spec</artifactId>
-            <version>1.0.0</version>
+            <version>1.1</version>
         </dependency>
         <dependency>
             <groupId>org.apache.servicemix.specs</groupId>

Modified: servicemix/smx4/specs/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/specs/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java?rev=1389477&r1=1389476&r2=1389477&view=diff
==============================================================================
--- servicemix/smx4/specs/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
(original)
+++ servicemix/smx4/specs/trunk/saaj-api-1.3/src/main/java/javax/xml/soap/FactoryFinder.java
Mon Sep 24 16:38:10 2012
@@ -79,22 +79,49 @@ class FactoryFinder {
      * @return a factory object
      * @throws SOAPException
      */
+    static Object find(Class factory,
+                       String defaultFactoryClassName) throws SOAPException {
+        return find(factory.getName(), factory, defaultFactoryClassName);
+    }
+    /**
+     * Instantiates a factory object given the factory's property name and the default class
name.
+     *
+     * @param factoryPropertyName
+     * @param defaultFactoryClassName
+     * @return a factory object
+     * @throws SOAPException
+     */
+    static Object find(String factoryPropertyName,
+                       String defaultFactoryClassName) throws SOAPException {
+        return find(factoryPropertyName, null, defaultFactoryClassName);
+    }
+    /**
+     * Instantiates a factory object given the factory's property name and the default class
name.
+     *
+     * @param factoryPropertyName
+     * @param defaultFactoryClassName
+     * @return a factory object
+     * @throws SOAPException
+     */
     static Object find(String factoryPropertyName,
+                       Class factoryClass,
                        String defaultFactoryClassName) throws SOAPException {
         try {
             // If we are deployed into an OSGi environment, leverage it
-            String factoryClassName = factoryPropertyName;
-            if (factoryPropertyName.equals("javax.xml.soap.MetaFactory")) {
-                //this is an exception that the factoryPropertyName isn't
-                //the actual factory class name, there is no class
-                //javax.xml.soap.MetaFactory at all
-                factoryClassName = "javax.xml.soap.SAAJMetaFactory";
-            }
-            ClassLoader cl = FactoryFinder.class.getClassLoader();
-            if (cl == null) {
-            	cl = Thread.currentThread().getContextClassLoader();
+            if (factoryClass == null) {
+                String factoryClassName = factoryPropertyName;
+                if (factoryPropertyName.equals("javax.xml.soap.MetaFactory")) {
+                    //this is an exception that the factoryPropertyName isn't
+                    //the actual factory class name, there is no class
+                    //javax.xml.soap.MetaFactory at all
+                    factoryClassName = "javax.xml.soap.SAAJMetaFactory";
+                }
+                ClassLoader cl = FactoryFinder.class.getClassLoader();
+                if (cl == null) {
+                    cl = Thread.currentThread().getContextClassLoader();
+                }
+                factoryClass = cl.loadClass(factoryClassName);
             }
-            Class factoryClass = cl.loadClass(factoryClassName);
             Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(factoryClass,
factoryPropertyName);
             if (spiClass != null) {
                 return spiClass.newInstance();



Mime
View raw message