Author: pcl
Date: Fri Aug 25 00:33:50 2006
New Revision: 436694

URL: http://svn.apache.org/viewvc?rev=436694&view=rev
Log:
OPENJPA-14. Use the class's classloader in environments when service lookups 
should be looking in the OpenJPA distribution. This imposes the restriction 
that OpenJPA will only find services in the same classloader as the OpenJPA 
jars themselves, which is a much better restriction than requiring that the 
classes be in the thread's context classloader.

Modified:
    
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
    
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
    
incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java

Modified: 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
URL: 
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java?rev=436694&r1=436693&r2=436694&view=diff
==============================================================================
--- 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
 (original)
+++ 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/ProductDerivations.java
 Fri Aug 25 00:33:50 2006
@@ -36,7 +36,8 @@
     private static final ProductDerivation[] _derivations;
 
     static {
-        Class[] pdcls = 
Services.getImplementorClasses(ProductDerivation.class);
+        Class[] pdcls = Services.getImplementorClasses(ProductDerivation.class,
+          ProductDerivations.class.getClassLoader());
         List derivations = new ArrayList(pdcls.length);
         for (int i = 0; i < pdcls.length; i++) {
             try {

Modified: 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: 
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=436694&r1=436693&r2=436694&view=diff
==============================================================================
--- 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
 (original)
+++ 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
 Fri Aug 25 00:33:50 2006
@@ -2617,7 +2617,7 @@
                if (_auxEnhancers == null) {
                    try {
                 Class[] classes = Services.getImplementorClasses
-                    (AuxiliaryEnhancer.class);
+                    (AuxiliaryEnhancer.class, getClass().getClassLoader());
                 _auxEnhancers = new AuxiliaryEnhancer[classes.length];
                 for (int i = 0; i < _auxEnhancers.length; i++)
                     _auxEnhancers[i] = (AuxiliaryEnhancer) classes[i].

Modified: 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
URL: 
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java?rev=436694&r1=436693&r2=436694&view=diff
==============================================================================
--- 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
 (original)
+++ 
incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java
 Fri Aug 25 00:33:50 2006
@@ -34,7 +34,7 @@
     static {
         // Load and cache all the query languages available in the system.
         Class[] classes = Services.getImplementorClasses(
-            ExpressionParser.class);
+            ExpressionParser.class, QueryLanguages.class.getClassLoader());
         for (int i = 0; i < classes.length; i++) {
             ExpressionParser ep;
             try {

Modified: 
incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
URL: 
http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java?rev=436694&r1=436693&r2=436694&view=diff
==============================================================================
--- 
incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
 (original)
+++ 
incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java
 Fri Aug 25 00:33:50 2006
@@ -42,7 +42,7 @@
  * &lt;/mytask&rt;
  * </code> 
  *
- * The defailt configuration for the system will be used if the
+ * The default configuration for the system will be used if the
  * <code>&lt;config&rt;</code> subtask is excluded.
  *
  * @nojavadoc


Reply via email to