geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r919410 - in /geronimo/specs/trunk/geronimo-saaj_1.3_spec: pom.xml src/main/java/javax/xml/soap/FactoryFinder.java
Date Fri, 05 Mar 2010 13:45:44 GMT
Author: rickmcguire
Date: Fri Mar  5 13:45:44 2010
New Revision: 919410

URL: http://svn.apache.org/viewvc?rev=919410&view=rev
Log:
GERONIMO-5133 Geroinimo versions of the specs should pick up the additions made to the service
mix versions of the bundles. 

updating the saaj factory lookups to support the osgi locator. 



Modified:
    geronimo/specs/trunk/geronimo-saaj_1.3_spec/pom.xml
    geronimo/specs/trunk/geronimo-saaj_1.3_spec/src/main/java/javax/xml/soap/FactoryFinder.java

Modified: geronimo/specs/trunk/geronimo-saaj_1.3_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-saaj_1.3_spec/pom.xml?rev=919410&r1=919409&r2=919410&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-saaj_1.3_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-saaj_1.3_spec/pom.xml Fri Mar  5 13:45:44 2010
@@ -7,9 +7,9 @@
     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
@@ -56,6 +56,12 @@
             <version>1.0.2</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-osgi-locator</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <scm>
@@ -71,7 +77,14 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-67 Soap with Attachments API for Java
1.3</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>1.0</Specification-Version>
                         <Export-Package>javax.xml.soap*;version=1.3</Export-Package>
+                        <Import-Package>org.apache.geronimo.osgi.registry.api;resolution:=optional,*</Import-Package>
+                        <Private-Package>org.apache.geronimo.osgi.locator</Private-Package>
+                        <Bundle-Activator>org.apache.geronimo.osgi.locator.Activator</Bundle-Activator>
                     </instructions>
                 </configuration>
             </plugin>

Modified: geronimo/specs/trunk/geronimo-saaj_1.3_spec/src/main/java/javax/xml/soap/FactoryFinder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-saaj_1.3_spec/src/main/java/javax/xml/soap/FactoryFinder.java?rev=919410&r1=919409&r2=919410&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-saaj_1.3_spec/src/main/java/javax/xml/soap/FactoryFinder.java
(original)
+++ geronimo/specs/trunk/geronimo-saaj_1.3_spec/src/main/java/javax/xml/soap/FactoryFinder.java
Fri Mar  5 13:45:44 2010
@@ -25,6 +25,8 @@
 import java.io.InputStreamReader;
 import java.util.Properties;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * This class is used to locate factory classes for javax.xml.soap. It has package scope
since it is
  * not part of JAXM and should not be accessed from other packages.
@@ -57,7 +59,18 @@
             }
             if (factory == null) {
                 classloader = FactoryFinder.class.getClassLoader();
-                factory = classloader.loadClass(factoryClassName);
+                try {
+                    factory = classloader.loadClass(factoryClassName);
+                } catch (ClassNotFoundException e) {
+                    // if the got a ClassNotFoundException using the provided class loader,
+                    // we might be running in an OSGi environment.  In that case, there's
+                    // an additional registry we can check to locate the provider.
+                    factory = ProviderLocator.locate(factoryClassName);
+                    // if not found here, then go ahead and throw the exception
+                    if (factory == null) {
+                        throw e;
+                    }
+                }
             }
             return factory.newInstance();
         } catch (ClassNotFoundException classnotfoundexception) {



Mime
View raw message