geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r921059 - in /geronimo/specs/trunk: geronimo-ejb_3.1_spec/ geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/ geronimo-jacc_1.1_spec/ geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/ geronimo-jaspic_1.0_spec/ geronimo-jaspic...
Date Tue, 09 Mar 2010 19:13:02 GMT
Author: rickmcguire
Date: Tue Mar  9 19:13:02 2010
New Revision: 921059

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

updates for ejb, persistence, jacc, and jaspic. 


Modified:
    geronimo/specs/trunk/geronimo-ejb_3.1_spec/pom.xml
    geronimo/specs/trunk/geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/EJBContainer.java
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/pom.xml
    geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
    geronimo/specs/trunk/geronimo-jaspic_1.0_spec/pom.xml
    geronimo/specs/trunk/geronimo-jaspic_1.0_spec/src/main/java/javax/security/auth/message/config/AuthConfigFactory.java
    geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
    geronimo/specs/trunk/geronimo-osgi-support/geronimo-osgi-locator/src/main/java/org/apache/geronimo/osgi/locator/ProviderLocator.java

Modified: geronimo/specs/trunk/geronimo-ejb_3.1_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-ejb_3.1_spec/pom.xml?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-ejb_3.1_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-ejb_3.1_spec/pom.xml Tue Mar  9 19:13:02 2010
@@ -70,6 +70,13 @@
             <version>1.1.1</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>
@@ -85,8 +92,14 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
-                        <!-- TODO how about javax.xml.rpc.handler which is in this jar??
-->
-                        <Export-Package>javax.ejb*;version=3.1</Export-Package>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-318 Enterprise Java Beans 3.1</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>3.1</Specification-Version>
+                        <Export-Package>javax.ejb*;version=3.1,javax.xml.rpc.handler;version=3.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.locator.Activator</Bundle-Activator>
                     </instructions>
                 </configuration>
             </plugin>

Modified: geronimo/specs/trunk/geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/EJBContainer.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/EJBContainer.java?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/EJBContainer.java
(original)
+++ geronimo/specs/trunk/geronimo-ejb_3.1_spec/src/main/java/javax/ejb/embeddable/EJBContainer.java
Tue Mar  9 19:13:02 2010
@@ -30,6 +30,8 @@ import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 public abstract class EJBContainer {
 
     public static final String PROVIDER = "javax.ejb.embeddable.provider";
@@ -83,7 +85,7 @@ public abstract class EJBContainer {
         Class providerClass;
 
         try {
-            providerClass = Class.forName(providerName, true, Thread.currentThread().getContextClassLoader());
+            providerClass = ProviderLocator.loadClass(providerName);
         } catch (Exception e) {
             throw new EJBException("Invalid or inaccessible provider class: " + providerName,
e);
         }

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/pom.xml?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/pom.xml Tue Mar  9 19:13:02 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
@@ -69,8 +69,14 @@
             <version>3.8.2</version>
             <scope>test</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>
         <plugins>
             <plugin>
@@ -78,8 +84,14 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-115 Java Authorization Contract for
Containers 1.1</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>1.1</Specification-Version>
                         <Export-Package>javax.security.jacc*;version=1.1</Export-Package>
-                        <Import-Package>javax.servlet*;resolution:=optional;version=2.5,*</Import-Package>
+                        <Import-Package>javax.servlet*;resolution:=optional;version=2.5,org.apache.geronimo.osgi.registry.api;resolution:=optional,*</Import-Package>
+                        <Private-Package>org.apache.geronimo.osgi.locator</Private-Package>
+                        <Bundle-Activator>org.apache.geronimo.locator.Activator</Bundle-Activator>
                     </instructions>
                 </configuration>
             </plugin>

Modified: geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/PolicyConfigurationFactory.java?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
(original)
+++ geronimo/specs/trunk/geronimo-jacc_1.1_spec/src/main/java/javax/security/jacc/PolicyConfigurationFactory.java
Tue Mar  9 19:13:02 2010
@@ -30,6 +30,8 @@ import java.security.PrivilegedActionExc
 import java.security.PrivilegedExceptionAction;
 import java.security.SecurityPermission;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * Abstract factory and finder class for obtaining the instance of the class
  * that implements the PolicyConfigurationFactory of a provider. The factory
@@ -84,7 +86,7 @@ public abstract class PolicyConfiguratio
                         if (factoryClassName[0] == null) throw new ClassNotFoundException("Property
" + FACTORY_NAME + " not set");
                         Thread currentThread = Thread.currentThread();
                         ClassLoader tccl = currentThread.getContextClassLoader();
-                        return Class.forName(factoryClassName[0], true, tccl).newInstance();
+                        return ProviderLocator.loadClass(factoryClassName[0], tccl).newInstance();
                     }
                 });
         } catch(PrivilegedActionException pae) {

Modified: geronimo/specs/trunk/geronimo-jaspic_1.0_spec/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaspic_1.0_spec/pom.xml?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaspic_1.0_spec/pom.xml (original)
+++ geronimo/specs/trunk/geronimo-jaspic_1.0_spec/pom.xml Tue Mar  9 19:13:02 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
@@ -55,6 +55,14 @@
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jaspic_1.0_spec/</developerConnection>
         <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-jaspic_1.0_spec/</url>
     </scm>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-osgi-locator</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
 
     <build>
         <plugins>
@@ -63,6 +71,16 @@
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
                     <instructions>
+                        <Bundle-SymbolicName>${groupId}.${artifactId};singleton=true</Bundle-SymbolicName>
+                        <Specification-Title>JSR-196 Java Authorization SPI for Containers
1.0</Specification-Title>
+                        <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+                        <Specification-Version>1.0</Specification-Version>
+                        <Export-Package>javax.security.auth.message*;version=1.0</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.locator.Activator</Bundle-Activator>
+                    </instructions>
+                    <instructions>
                         <Export-Package>javax.security.auth.message*;version=1.0</Export-Package>
                     </instructions>
                 </configuration>

Modified: geronimo/specs/trunk/geronimo-jaspic_1.0_spec/src/main/java/javax/security/auth/message/config/AuthConfigFactory.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jaspic_1.0_spec/src/main/java/javax/security/auth/message/config/AuthConfigFactory.java?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jaspic_1.0_spec/src/main/java/javax/security/auth/message/config/AuthConfigFactory.java
(original)
+++ geronimo/specs/trunk/geronimo-jaspic_1.0_spec/src/main/java/javax/security/auth/message/config/AuthConfigFactory.java
Tue Mar  9 19:13:02 2010
@@ -22,6 +22,8 @@ import java.util.Map;
 import javax.security.auth.AuthPermission;
 import javax.security.auth.message.AuthException;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -63,7 +65,7 @@ public abstract class AuthConfigFactory 
                         .doPrivileged(new java.security.PrivilegedExceptionAction() {
                             public Object run() throws ClassNotFoundException, InstantiationException,
                                     IllegalAccessException {
-                                return Class.forName(finalClassName, true, contextClassLoader).newInstance();
+                                return ProviderLocator.loadClass(finalClassName, contextClassLoader).newInstance();
                             }
                         });
             } catch (PrivilegedActionException e) {

Modified: geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
(original)
+++ geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
Tue Mar  9 19:13:02 2010
@@ -41,10 +41,12 @@ import javax.persistence.spi.Persistence
 import javax.persistence.spi.PersistenceProviderResolverHolder;
 import javax.persistence.spi.ProviderUtil;
 
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
 /**
  * Bootstrap class to obtain {@link javax.persistence.EntityManagerFactory}
  * references.
- * 
+ *
  * Contains Geronimo implemented code as required by the JPA spec.
  *
  * @version $Rev$ $Date$
@@ -75,7 +77,7 @@ public class Persistence {
      */
     public static EntityManagerFactory createEntityManagerFactory(
             String persistenceUnitName, Map properties) {
-        
+
         EntityManagerFactory factory = null;
         Map props = properties;
         if (props == null) {
@@ -93,10 +95,10 @@ public class Persistence {
          * explicitly specified in the properties and return any exceptions.
          * The spec doesn't forbid providers that aren't a service - it only
          * states that they "should" be implemented as services in Sect. 9.2.
-         * 
+         *
          * For 2.0 - We only perform the above behavior if the specified
          * provider is not in the discovered list.
-         * 
+         *
          * Note: This special non-spec defined case will rethrow any encountered
          * Exceptions as a PersistenceException.
          */
@@ -126,10 +128,10 @@ public class Persistence {
                 }
             }
         }
-        
+
         /*
          * Now, the default JPA2 behavior of loading a provider from our resolver
-         * 
+         *
          * Note:  Change in behavior from 1.0, which always returned exceptions:
          *   Spec states that a provider "must" return null if it
          *   cannot fulfill an EMF request, so that if we have more than one
@@ -138,16 +140,16 @@ public class Persistence {
          *   PersistenceException to match 1.0 behavior and provide more
          *   diagnostics to the end user.
          */
-        
+
         // capture any provider returned exceptions
         Map<String, Throwable> exceptions = new HashMap<String, Throwable>();
         // capture the provider names to use in the exception text if needed
         StringBuffer foundProviders = null;
-        
+
         for (PersistenceProvider provider : providers) {
             String providerName = provider.getClass().getName();
             try {
-                factory = provider.createEntityManagerFactory(persistenceUnitName, props);
                   
+                factory = provider.createEntityManagerFactory(persistenceUnitName, props);
             } catch (Exception e) {
                 // capture the exception details and give other providers a chance
                 exceptions.put(providerName, e);
@@ -205,7 +207,7 @@ public class Persistence {
             cl = PrivClassLoader.get(Persistence.class);
 
         try {
-            providerClass = Class.forName(providerName, true, cl);
+            providerClass = ProviderLocator.loadClass(providerName);
         } catch (Exception e) {
             throw new PersistenceException("Invalid or inaccessible explicit provider class:
" +
                 providerName, e);
@@ -218,8 +220,8 @@ public class Persistence {
                 providerName + " for PU: " + persistenceUnitName, e);
         }
     }
-    
-    
+
+
     /**
      * Geronimo/OpenJPA private helper code for creating a PersistenceException
      * @param msg String to use as the exception message
@@ -239,7 +241,7 @@ public class Persistence {
                 strWriter.append(providerName);
                 break;
             }
-            return new PersistenceException(strWriter.toString(), t);                
+            return new PersistenceException(strWriter.toString(), t);
         } else {
             // we caught multiple exceptions, so format them into the message string and
don't set a cause
             strWriter.append(" with the following failures:");
@@ -257,28 +259,28 @@ public class Persistence {
     public static PersistenceUtil getPersistenceUtil() {
         return new PersistenceUtilImpl();
     }
-    
+
     /**
      * Geronimo implementation specific code
      */
     private static class PersistenceUtilImpl implements PersistenceUtil {
 
         /**
-         * Determines the load state of the attribute of an entity 
+         * Determines the load state of the attribute of an entity
          * @see javax.persistence.PersistenceUtil#isLoaded(java.lang.Object, java.lang.String)
          */
             public boolean isLoaded(Object entity, String attributeName) {
                 boolean isLoaded = true;
 
                 // Get the list of persistence providers from the resolver
-                PersistenceProviderResolver ppr = 
+                PersistenceProviderResolver ppr =
                     PersistenceProviderResolverHolder.getPersistenceProviderResolver();
                 List<PersistenceProvider> pps = ppr.getPersistenceProviders();
 
                 // Iterate through the list using ProviderUtil.isLoadedWithoutReference()
                 for (PersistenceProvider pp : pps) {
                     try {
-                        ProviderUtil pu = pp.getProviderUtil();                        
+                        ProviderUtil pu = pp.getProviderUtil();
                         LoadState ls = pu.isLoadedWithoutReference(entity, attributeName);
                         if (ls == LoadState.LOADED)
                             return true;
@@ -293,7 +295,7 @@ public class Persistence {
                 // Iterate through the list a second time using ProviderUtil.isLoadedWithReference()
                 for (PersistenceProvider pp : pps) {
                     try {
-                        ProviderUtil pu = pp.getProviderUtil();                        
+                        ProviderUtil pu = pp.getProviderUtil();
                         LoadState ls = pu.isLoadedWithReference(entity, attributeName);
                         if (ls == LoadState.LOADED)
                             return true;
@@ -305,14 +307,14 @@ public class Persistence {
                         // method.  Eat the exception and try the next provider.
                     }
                  }
-                
+
                 // All providers returned a load state of unknown.  Return true.
                 return true;
             }
 
             public boolean isLoaded(Object entity) {
                 // Get the list of persistence providers from the resolver
-                PersistenceProviderResolver ppr = 
+                PersistenceProviderResolver ppr =
                     PersistenceProviderResolverHolder.getPersistenceProviderResolver();
                 List<PersistenceProvider> pps = ppr.getPersistenceProviders();
 
@@ -331,9 +333,9 @@ public class Persistence {
                     catch (Throwable t) {
                         // JPA 1.0 providers will not implement the getProviderUtil
                         // method.  Eat the exception and try the next provider.
-                    }                   
+                    }
                 }
-                
+
                 // All providers returned a load state of unknown.  Return true.
                 return true;
             }

Modified: geronimo/specs/trunk/geronimo-osgi-support/geronimo-osgi-locator/src/main/java/org/apache/geronimo/osgi/locator/ProviderLocator.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-osgi-support/geronimo-osgi-locator/src/main/java/org/apache/geronimo/osgi/locator/ProviderLocator.java?rev=921059&r1=921058&r2=921059&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-osgi-support/geronimo-osgi-locator/src/main/java/org/apache/geronimo/osgi/locator/ProviderLocator.java
(original)
+++ geronimo/specs/trunk/geronimo-osgi-support/geronimo-osgi-locator/src/main/java/org/apache/geronimo/osgi/locator/ProviderLocator.java
Tue Mar  9 19:13:02 2010
@@ -140,15 +140,8 @@ public class ProviderLocator {
      *                   Thrown if the class cannot be loaded.
      */
     static public Class<?> loadClass(String className, ClassLoader loader) throws ClassNotFoundException
{
-        if (loader != null) {
-            try {
-                return loader.loadClass(className);
-            } catch (ClassNotFoundException x) {
-                // try again
-            }
-        }
         try {
-            return Class.forName(className);
+            return Class.forName(className, true, loader);
         } catch (ClassNotFoundException x) {
             // last gasp, use the OSGi locator to try to find this
             Class cls = locate(className);



Mime
View raw message