geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r919429 - in /geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec: pom.xml src/main/java/javax/xml/ws/spi/FactoryFinder.java
Date Fri, 05 Mar 2010 14:28:39 GMT
Author: rickmcguire
Date: Fri Mar  5 14:28:38 2010
New Revision: 919429

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

Changes for the JAX-WS spec bundle. 


Modified:
    geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/pom.xml
    geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/spi/FactoryFinder.java

Modified: geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/pom.xml?rev=919429&r1=919428&r2=919429&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/pom.xml Fri Mar  5 14:28:38 2010
@@ -80,6 +80,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>
 
     <build>
@@ -89,7 +95,14 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-224 Java API for XML based Web Services
2.1.1</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>2.1.1</Specification-Version>
                         <Export-Package>javax.xml.ws*;version=2.1.1</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-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/spi/FactoryFinder.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/spi/FactoryFinder.java?rev=919429&r1=919428&r2=919429&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/spi/FactoryFinder.java
(original)
+++ geronimo/specs/trunk/geronimo-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/spi/FactoryFinder.java
Fri Mar  5 14:28:38 2010
@@ -29,6 +29,8 @@
 import java.security.PrivilegedAction;
 import java.util.Properties;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * This code is designed to implement the pluggability
  * feature and is designed to both compile and run on JDK version 1.1 and
@@ -61,13 +63,13 @@
      */
     private static ClassLoader findClassLoader()
             throws ConfigurationError {
-        // REVIEW This doPriv block may be unnecessary because this method is private and

-        // the caller already has a doPriv.  I added the doPriv in case someone changes the

+        // REVIEW This doPriv block may be unnecessary because this method is private and
+        // the caller already has a doPriv.  I added the doPriv in case someone changes the
         // visibility of this method to non-private.
         ClassLoader cl = (ClassLoader)
             doPrivileged( new PrivilegedAction() {
                 public Object run() {
-                
+
                     Method m = null;
 
                     try {
@@ -94,7 +96,7 @@
             }
         );
         return cl;
-        
+
     }
 
     /**
@@ -112,14 +114,14 @@
     private static Object newInstance(String className,
                                       ClassLoader classLoader)
             throws ConfigurationError {
-        
+
         final ClassLoader iClassLoader = classLoader;
         final String iClassName = className;
-        
-        // REVIEW This doPriv block may be unnecessary because this method is private and

-        // the caller already has a doPriv.  I added the doPriv in case someone changes the

+
+        // REVIEW This doPriv block may be unnecessary because this method is private and
+        // the caller already has a doPriv.  I added the doPriv in case someone changes the
         // visibility of this method to non-private.
-        Object obj = 
+        Object obj =
             doPrivileged( new PrivilegedAction() {
                 public Object run() {
                     try {
@@ -130,7 +132,16 @@
                                 // try again
                             }
                         }
-                        return Class.forName(iClassName).newInstance();
+                        try {
+                            return Class.forName(iClassName).newInstance();
+                        } catch (ClassNotFoundException x) {
+                            // last gasp, use the OSGi locator to try to find this
+                            Class cls = ProviderLocator.locate(iClassName);
+                            if (cls == null) {
+                                throw x;
+                            }
+                            return cls.newInstance();
+                        }
                     } catch (ClassNotFoundException x) {
                         throw new ConfigurationError(
                                 "Provider " + iClassName + " not found", x);
@@ -158,17 +169,17 @@
      */
     static Object find(String factoryId, String fallbackClassName)
             throws ConfigurationError {
-        
+
         final String iFactoryId = factoryId;
         final String iFallbackClassName = fallbackClassName;
-        
-        Object obj = 
+
+        Object obj =
             doPrivileged( new PrivilegedAction() {
                 public Object run() {
                     debugPrintln("debug is on");
-                    
+
                     ClassLoader classLoader = findClassLoader();
-                    
+
                     // Use the system property first
                     try {
                         String systemProp =
@@ -179,7 +190,7 @@
                         }
                     } catch (SecurityException se) {
                     }
-                    
+
                     // try to read from $java.home/lib/xml.properties
                     try {
                         String javah = System.getProperty("java.home");
@@ -196,7 +207,7 @@
                     } catch (Exception ex) {
                         if (debug) ex.printStackTrace();
                     }
-                    
+
                     String serviceId = "META-INF/services/" + iFactoryId;
                     // try to find services in CLASSPATH
                     try {
@@ -206,10 +217,10 @@
                         } else {
                             is = classLoader.getResourceAsStream(serviceId);
                         }
-                        
+
                         if (is != null) {
                             debugPrintln("found " + serviceId);
-                            
+
                             // Read the service provider name in UTF-8 as specified in
                             // the jar spec.  Unfortunately this fails in Microsoft
                             // VJ++, which does not implement the UTF-8
@@ -232,10 +243,10 @@
                             } catch (java.io.UnsupportedEncodingException e) {
                                 rd = new BufferedReader(new InputStreamReader(is));
                             }
-                            
+
                             String factoryClassName = rd.readLine();
                             rd.close();
-                            
+
                             if (factoryClassName != null &&
                                     ! "".equals(factoryClassName)) {
                                 debugPrintln("loaded from services: " + factoryClassName);
@@ -245,12 +256,12 @@
                     } catch (Exception ex) {
                         if (debug) ex.printStackTrace();
                     }
-                    
+
                     if (iFallbackClassName == null) {
                         throw new ConfigurationError(
                                 "Provider for " + iFactoryId + " cannot be found", null);
                     }
-                    
+
                     debugPrintln("loaded from fallback value: " + iFallbackClassName);
                     return newInstance(iFallbackClassName, classLoader);
                 }



Mime
View raw message