openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From curti...@apache.org
Subject svn commit: r1197994 [2/10] - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/ant/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/...
Date Sat, 05 Nov 2011 17:17:33 GMT
Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java Sat Nov  5 17:17:26 2011
@@ -473,7 +473,7 @@ public class MappingTool
             if (_dropCls != null && !_dropCls.isEmpty()) {
                 Class<?>[] cls = (Class[]) _dropCls.toArray
                     (new Class[_dropCls.size()]);
-                if (!io.drop(cls, _mode))
+                if (!io.drop(cls, _mode, null))
                     _log.warn(_loc.get("bad-drop", _dropCls));
             }
 
@@ -608,7 +608,7 @@ public class MappingTool
         SequenceMetaData smd = mapping.getIdentitySequenceMetaData();
         Seq seq = null;
         if (smd != null)
-            seq = smd.getInstance();
+            seq = smd.getInstance(null);
         else if (mapping.getIdentityStrategy() == ValueStrategies.NATIVE
             || (mapping.getIdentityStrategy() == ValueStrategies.NONE
             && mapping.getIdentityType() == ClassMapping.ID_DATASTORE))
@@ -625,7 +625,7 @@ public class MappingTool
         for (int i = 0; i < fmds.length; i++) {
             smd = fmds[i].getValueSequenceMetaData();
             if (smd != null) {
-                seq = smd.getInstance();
+                seq = smd.getInstance(null);
                 if (seq instanceof JDBCSeq)
                     ((JDBCSeq) seq).addSchema(mapping, group);
             } else if (fmds[i].getEmbeddedMapping() != null)
@@ -679,7 +679,7 @@ public class MappingTool
         boolean validate) {
         // this will parse all possible metadata rsrcs looking for cls, so
         // will detect if p-aware
-        ClassMapping mapping = repos.getMapping(cls, false);
+        ClassMapping mapping = repos.getMapping(cls, null, false);
         if (mapping != null)
             return mapping;
         if (!validate || cls.isInterface() 
@@ -790,7 +790,7 @@ public class MappingTool
         repos.setStrategyInstaller(new RuntimeStrategyInstaller(repos));
         ClassMapping mapping = null;
         try {
-            mapping = repos.getMapping(cls, false);
+            mapping = repos.getMapping(cls, null, false);
         } catch (Exception e) {
         }
 
@@ -985,7 +985,8 @@ public class MappingTool
             opts.setProperty("schemas", schemas);
 
         Configurations.populateConfiguration(conf, opts);
-        ClassLoader loader = conf.getClassLoader();
+        ClassLoader loader = conf.getClassResolverInstance().
+            getClassLoader(MappingTool.class, null);
         if (flags.meta && ACTION_ADD.equals(flags.action))
             flags.metaDataFile = Files.getFile(fileName, loader);
         else
@@ -1021,12 +1022,13 @@ public class MappingTool
             if (ACTION_IMPORT.equals(flags.action))
                 return false;
             log.info(_loc.get("running-all-classes"));
-            classes = conf.getMappingRepositoryInstance().loadPersistentTypes(true);
+            classes = conf.getMappingRepositoryInstance().
+                loadPersistentTypes(true, loader);
         } else {
             classes = new HashSet<Class<?>>();
             ClassArgParser classParser = conf.getMetaDataRepositoryInstance().
                 getMetaDataFactory().newClassArgParser();
-            classParser.setClassLoader(conf.getClassLoader());
+            classParser.setClassLoader(loader);
             Class<?>[] parsed;
             for (int i = 0; i < args.length; i++) {
                 parsed = classParser.parseTypes(args[i]);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MetaDataPlusMappingFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MetaDataPlusMappingFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MetaDataPlusMappingFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MetaDataPlusMappingFactory.java Sat Nov  5 17:17:26 2011
@@ -45,17 +45,28 @@ public class MetaDataPlusMappingFactory
 
     
     /**
+     * Constructor; supply delegates.
+     */
+    public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map) {
+        this(meta, map, null);
+
+    }
+    
+    /**
      * Constructor, supply delegates and Configuration. 
      * 
      * @param meta MetaFactory delegate, should not be null.
      * @param map  MappingFactory delegate, should not be null.
      * @param conf Configuration in use. Used to determine whether delegates should use strict mode. 
      */
-    public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, boolean strict) {
+    public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, OpenJPAConfiguration conf) {
         super(meta);
         _map = map;
-        meta.setStrict(strict);
-        map.setStrict(strict);        
+
+        if(conf.getCompatibilityInstance().getMetaFactoriesAreStrict()) {
+            meta.setStrict(true);
+            map.setStrict(true);
+        }
     }
 
     /**
@@ -93,37 +104,40 @@ public class MetaDataPlusMappingFactory
         // always in strict mode
     }
 
-    public void load(Class cls, int mode) {
+    public void load(Class cls, int mode, ClassLoader envLoader) {
         if ((mode & ~MODE_MAPPING) != MODE_NONE)
-            super.load(cls, mode & ~MODE_MAPPING);
+            super.load(cls, mode & ~MODE_MAPPING, envLoader);
         if (cls != null && (mode & MODE_MAPPING) != 0)
-            _map.load(cls, mode & ~MODE_META);
+            _map.load(cls, mode & ~MODE_META, envLoader);
     }
 
     public boolean store(ClassMetaData[] metas, QueryMetaData[] queries,
         SequenceMetaData[] seqs, int mode, Map output) {
         boolean store = true;
         if ((mode & ~MODE_MAPPING) != MODE_NONE)
-            store &= super.store(metas, queries, seqs, mode & ~MODE_MAPPING, output);
+            store &= super.store(metas, queries, seqs, mode & ~MODE_MAPPING,
+                output);
         if ((mode & MODE_MAPPING) != 0)
-            store &= _map.store(metas, queries, seqs, mode & ~MODE_META, output);
+            store &= _map.store(metas, queries, seqs, mode & ~MODE_META,
+                output);
         return store;
     }
 
-    public boolean drop(Class[] cls, int mode) {
+    public boolean drop(Class[] cls, int mode, ClassLoader envLoader) {
         boolean drop = true;
         if ((mode & ~MODE_MAPPING) != MODE_NONE)
-            drop &= super.drop(cls, mode & ~MODE_MAPPING);
+            drop &= super.drop(cls, mode & ~MODE_MAPPING, envLoader);
         if ((mode & MODE_MAPPING) != 0)
-            drop &= _map.drop(cls, mode & ~MODE_META);
+            drop &= _map.drop(cls, mode & ~MODE_META, envLoader);
         return drop;
     }
 
-    public Set getPersistentTypeNames(boolean classpath) {
-        Set names = super.getPersistentTypeNames(classpath);
+    public Set getPersistentTypeNames(boolean classpath,
+        ClassLoader envLoader) {
+        Set names = super.getPersistentTypeNames(classpath, envLoader);
         if (names != null && !names.isEmpty())
             return names;
-        return _map.getPersistentTypeNames(classpath);
+        return _map.getPersistentTypeNames(classpath, envLoader);
     }
 
     public void clear() {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/QueryResultMapping.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/QueryResultMapping.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/QueryResultMapping.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/QueryResultMapping.java Sat Nov  5 17:17:26 2011
@@ -282,7 +282,7 @@ public class QueryResultMapping
          */
         public ClassMapping getCandidateTypeMapping() {
             if (_candidateMap == null)
-                _candidateMap = _repos.getMapping(_candidate, true);
+                _candidateMap = _repos.getMapping(_candidate, null, true);
             return _candidateMap;
         }
 

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java Sat Nov  5 17:17:26 2011
@@ -1652,7 +1652,9 @@ public class ReverseMappingTool
                     propNames[propNames.length - 1]));
 
             if (typeSpec != null)
-                type = Strings.toClass(typeSpec, _conf.getClassLoader());
+                type = Strings.toClass(typeSpec, _conf.
+                    getClassResolverInstance().getClassLoader
+                    (ReverseMappingTool.class, null));
         }
 
         if (type == null)
@@ -1941,12 +1943,15 @@ public class ReverseMappingTool
 
         // setup a configuration instance with cmd-line info
         Configurations.populateConfiguration(conf, opts);
-        ClassLoader loader = conf.getClassLoader();
+        ClassLoader loader = conf.getClassResolverInstance().
+            getClassLoader(ReverseMappingTool.class, null);
 
         // customizer
-        flags.customizer = (ReverseCustomizer) Configurations.newInstance(customCls, conf, customOpts);
+        flags.customizer = (ReverseCustomizer) Configurations.
+            newInstance(customCls, loader);
         if (flags.customizer != null) {
-            Configurations.configureInstance(flags.customizer, conf, customOpts);
+            Configurations.configureInstance(flags.customizer, conf,
+                customOpts);
             flags.customizer.setConfiguration(customProps);
         }
 

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ClassNameDiscriminatorStrategy.java Sat Nov  5 17:17:26 2011
@@ -62,7 +62,7 @@ public class ClassNameDiscriminatorStrat
 
     protected Class getClass(Object val, JDBCStore store)
         throws ClassNotFoundException {
-        ClassLoader loader = store.getConfiguration().getClassLoader();
+        ClassLoader loader = getClassLoader(store);
         return Class.forName((String) val, true, loader);
     }
 
@@ -84,7 +84,7 @@ public class ClassNameDiscriminatorStrat
         if (log.isTraceEnabled())
             log.trace(_loc.get("load-subs", col.getTable().getFullName()));
 
-        ClassLoader loader = store.getConfiguration().getClassLoader();
+        ClassLoader loader = getClassLoader(store);
         Connection conn = store.getConnection();
         PreparedStatement stmnt = null;
         ResultSet rs = null;
@@ -119,4 +119,12 @@ public class ClassNameDiscriminatorStrat
         }
     }
 
+    /**
+     * Return the class loader to use for loading class names.
+     */
+    private ClassLoader getClassLoader(JDBCStore store) {
+        return store.getConfiguration().getClassResolverInstance().
+            getClassLoader(disc.getClassMapping().getDescribedType(),
+                store.getContext().getClassLoader());
+    }
 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationStrategies.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationStrategies.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationStrategies.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationStrategies.java Sat Nov  5 17:17:26 2011
@@ -87,7 +87,8 @@ public class RelationStrategies {
         } else if (val.getClass() == vm.getType())
             rel = vm.getTypeMapping(); // common case
         else {
-            rel = vm.getMappingRepository().getMapping(val.getClass(), true);
+            rel = vm.getMappingRepository().getMapping(val.getClass(),
+                store.getContext().getClassLoader(), true);
         }
         if (!rel.isMapped())
             throw new UserException(_loc.get("unmapped-datastore-value", 

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/UntypedPCValueHandler.java Sat Nov  5 17:17:26 2011
@@ -113,7 +113,9 @@ public class UntypedPCValueHandler
         String oidStr = str.substring(idx + 1);
 
         StoreContext ctx = store.getContext();
-        ClassLoader loader = store.getConfiguration().getClassLoader();
+        ClassLoader loader = store.getConfiguration().
+            getClassResolverInstance().getClassLoader(vm.getType(),
+            ctx.getClassLoader());
         Class cls = null;
         try {
             cls = Class.forName(clsName, true, loader);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DBCPDriverDataSource.java Sat Nov  5 17:17:26 2011
@@ -99,7 +99,8 @@ extends SimpleDriverDataSource implement
             if (_ds == null) {
                 try {
                     Properties dbcpProps = updateDBCPProperties(props);
-                    _ds = (DataSource) Configurations.newInstance(DBCPBASICDATASOURCENAME, conf, dbcpProps);
+                    _ds = (DataSource) Configurations.newInstance(DBCPBASICDATASOURCENAME, conf,
+                        dbcpProps, getClassLoader());
                 } catch (Exception e) {
                     _dbcpEx = new RuntimeException(_eloc.get("driver-null", DBCPBASICDATASOURCENAME).getMessage(), e);
                 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/DataSourceFactory.java Sat Nov  5 17:17:26 2011
@@ -66,13 +66,18 @@ public class DataSourceFactory {
     /**
      * Create a datasource using the given configuration.
      */
-    public static DataSource newDataSource(JDBCConfiguration conf,  boolean factory2) {
-        String driver = (factory2) ? conf.getConnection2DriverName() : conf.getConnectionDriverName();
-        if (StringUtils.isEmpty(driver)) {
-            throw new UserException(_loc.get("no-driver", conf)).setFatal(true);
-        }
-        ClassLoader loader = conf.getClassLoader();
-        String props = (factory2) ? conf.getConnection2Properties() : conf.getConnectionProperties();
+    public static DataSource newDataSource(JDBCConfiguration conf,
+        boolean factory2) {
+        String driver = (factory2) ? conf.getConnection2DriverName()
+            : conf.getConnectionDriverName();
+        if (StringUtils.isEmpty(driver))
+            throw new UserException(_loc.get("no-driver", conf)).
+                setFatal(true);
+
+        ClassLoader loader = conf.getClassResolverInstance().
+            getClassLoader(DataSourceFactory.class, null);
+        String props = (factory2) ? conf.getConnection2Properties()
+            : conf.getConnectionProperties();
         try {
             Class<?> driverClass;
             try {
@@ -108,7 +113,10 @@ public class DataSourceFactory {
 
             // see if their driver name is actually a data source
             if (DataSource.class.isAssignableFrom(driverClass)) {
-                return (DataSource) Configurations.newInstance(driver, conf, props); 
+                return (DataSource) Configurations.newInstance(driver,
+                    conf, props, AccessController.doPrivileged(
+                        J2DoPrivHelper.getClassLoaderAction(
+                            DataSource.class))); 
             }
         }
         catch (OpenJPAException ke) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/FileSchemaFactory.java Sat Nov  5 17:17:26 2011
@@ -21,12 +21,13 @@ package org.apache.openjpa.jdbc.schema;
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+import java.security.AccessController;
 
 import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
 import org.apache.openjpa.lib.conf.Configurable;
 import org.apache.openjpa.lib.conf.Configuration;
-import org.apache.openjpa.lib.meta.MetaDataSerializer;
 import org.apache.openjpa.lib.util.Files;
+import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.util.GeneralException;
 
 /**
@@ -39,6 +40,7 @@ public class FileSchemaFactory
 
     private JDBCConfiguration _conf = null;
     private String _fileName = "package.schema";
+    private ClassLoader _loader = null;
 
     /**
      * Return the XML resource defining this schema. Defaults to
@@ -66,6 +68,8 @@ public class FileSchemaFactory
 
     public void setConfiguration(Configuration conf) {
         _conf = (JDBCConfiguration) conf;
+        _loader = _conf.getClassResolverInstance().
+            getClassLoader(getClass(), null);
     }
 
     public void startConfiguration() {
@@ -75,7 +79,8 @@ public class FileSchemaFactory
     }
 
     public SchemaGroup readSchema() {
-        URL url = _conf.getClassLoader().getResource(_fileName); 
+        URL url = AccessController.doPrivileged(
+            J2DoPrivHelper.getResourceAction(_loader, _fileName)); 
         if (url == null)
             return new SchemaGroup();
 
@@ -89,11 +94,11 @@ public class FileSchemaFactory
     }
 
     public void storeSchema(SchemaGroup schema) {
-        File file = Files.getFile(_fileName, _conf.getClassLoader());
+        File file = Files.getFile(_fileName, _loader);
         XMLSchemaSerializer ser = new XMLSchemaSerializer(_conf);
         ser.addAll(schema);
         try {
-            ser.serialize(file, MetaDataSerializer.PRETTY);
+            ser.serialize(file, ser.PRETTY);
         } catch (IOException ioe) {
             throw new GeneralException(ioe);
         }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java Sat Nov  5 17:17:26 2011
@@ -1423,7 +1423,8 @@ public class SchemaTool {
         Configurations.populateConfiguration(conf, opts);
 
         // create script writer
-        ClassLoader loader = conf.getClassLoader();
+        ClassLoader loader = conf.getClassResolverInstance().
+            getClassLoader(SchemaTool.class, null);
         flags.writer = Files.getWriter(fileName, loader);
 
         boolean returnValue = true;

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/XMLSchemaParser.java Sat Nov  5 17:17:26 2011
@@ -124,7 +124,6 @@ public class XMLSchemaParser
      * Constructor. Supply configuration.
      */
     public XMLSchemaParser(JDBCConfiguration conf) {
-    	super(conf.getClassLoader());
         _dict = conf.getDBDictionaryInstance();
         setLog(conf.getLog(JDBCConfiguration.LOG_SCHEMA));
         setParseText(false);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Sat Nov  5 17:17:26 2011
@@ -1223,7 +1223,9 @@ public class OracleDictionary
         if (EMPTY_CLOB != null)
             return EMPTY_CLOB;
         try {
-            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, conf.getClassLoader()).
+            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, 
+                    AccessController.doPrivileged(J2DoPrivHelper
+                            .getContextClassLoaderAction())).
                 getMethod("empty_lob", new Class[0]).
                 invoke(null, new Object[0]);
         } catch (Exception e) {
@@ -1236,7 +1238,9 @@ public class OracleDictionary
         if (EMPTY_BLOB != null)
             return EMPTY_BLOB;
         try {
-            return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB",true, conf.getClassLoader()).
+            return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB",true, 
+                    AccessController.doPrivileged(J2DoPrivHelper
+                            .getContextClassLoaderAction())).
                 getMethod("empty_lob", new Class[0]).
                 invoke(null, new Object[0]);
         } catch (Exception e) {

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PostgresDictionary.java Sat Nov  5 17:17:26 2011
@@ -920,9 +920,12 @@ public class PostgresDictionary
         try {
             if (dbcpGetDelegate == null) {
                 Class<?> dbcpConnectionClass =
-                    Class.forName("org.apache.commons.dbcp.DelegatingConnection", true, conf.getClassLoader());
+                    Class.forName("org.apache.commons.dbcp.DelegatingConnection", true, AccessController
+                        .doPrivileged(J2DoPrivHelper.getContextClassLoaderAction()));
                 Class<?> poolingDataSource = Class.forName(
-                        "org.apache.commons.dbcp.PoolingDataSource", true, conf.getClassLoader());
+                        "org.apache.commons.dbcp.PoolingDataSource", true,
+                        AccessController.doPrivileged(J2DoPrivHelper
+                                .getContextClassLoaderAction()));
                 Method setAccessToUnderlyingConnectionAllowed = poolingDataSource
                         .getMethod("setAccessToUnderlyingConnectionAllowed",
                                 boolean.class);

Modified: openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/JESTContext.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/JESTContext.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/JESTContext.java (original)
+++ openjpa/trunk/openjpa-jest/src/main/java/org/apache/openjpa/persistence/jest/JESTContext.java Sat Nov  5 17:17:26 2011
@@ -213,7 +213,7 @@ public class JESTContext implements JPAS
     
     public ClassMetaData resolve(String alias) {
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        return _repos.getMetaData(alias, true);
+        return _repos.getMetaData(alias, loader, true);
     }
     
     /**

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreBrokerFactory.java Sat Nov  5 17:17:26 2011
@@ -18,18 +18,19 @@
  */
 package org.apache.openjpa.abstractstore;
 
+import java.security.AccessController;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.openjpa.conf.OpenJPAConfiguration;
-import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
 import org.apache.openjpa.kernel.AbstractBrokerFactory;
 import org.apache.openjpa.kernel.Bootstrap;
 import org.apache.openjpa.kernel.BrokerFactory;
 import org.apache.openjpa.kernel.StoreManager;
-import org.apache.openjpa.lib.conf.Configuration;
 import org.apache.openjpa.lib.conf.ConfigurationProvider;
 import org.apache.openjpa.lib.conf.Configurations;
 import org.apache.openjpa.lib.conf.ProductDerivations;
+import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.util.UserException;
 
@@ -49,7 +50,6 @@ import org.apache.openjpa.util.UserExcep
  * and bootstrapping from a {@link Map} object (the strategy used by
  * {@link Bootstrap} to create a factory in a vendor-neutral manner).
  */
-@SuppressWarnings("serial")
 public class AbstractStoreBrokerFactory
     extends AbstractBrokerFactory {
 
@@ -57,9 +57,11 @@ public class AbstractStoreBrokerFactory
      * The property name under which to name the concrete store manager
      * class for this runtime.
      */
-    private static final String PROP_ABSTRACT_STORE = "abstractstore.AbstractStoreManager";
+    private static final String PROP_ABSTRACT_STORE =
+        "abstractstore.AbstractStoreManager";
 
-    private static final Localizer s_loc = Localizer.forPackage(AbstractStoreBrokerFactory.class);
+    private static final Localizer s_loc = Localizer.forPackage
+        (AbstractStoreBrokerFactory.class);
 
     private String _storeCls = null;
     private String _storeProps = null;
@@ -69,9 +71,11 @@ public class AbstractStoreBrokerFactory
      * Factory method for obtaining a possibly-pooled {@link BrokerFactory}
      * from properties. Invoked from {@link Bootstrap#getBrokerFactory()}.
      */
-    public static AbstractStoreBrokerFactory getInstance(ConfigurationProvider cp) {
+    public static AbstractStoreBrokerFactory getInstance(
+        ConfigurationProvider cp) {
         Object key = toPoolKey(cp.getProperties());
-        AbstractStoreBrokerFactory factory = (AbstractStoreBrokerFactory)getPooledFactoryForKey(key);
+        AbstractStoreBrokerFactory factory = (AbstractStoreBrokerFactory)
+            getPooledFactoryForKey(key);
         if (factory != null)
             return factory;
 
@@ -84,16 +88,17 @@ public class AbstractStoreBrokerFactory
      * Factory method for constructing a {@link BrokerFactory}
      * from properties. Invoked from {@link Bootstrap#newBrokerFactory()}.
      */
-    public static AbstractStoreBrokerFactory newInstance(ConfigurationProvider cp) {
+    public static AbstractStoreBrokerFactory newInstance
+        (ConfigurationProvider cp) {
         // use a tmp store manager to get metadata about the capabilities of
         // this runtime
         Map map = cp.getProperties();
-        OpenJPAConfiguration tmp = new OpenJPAConfigurationImpl();
-        cp.setInto(tmp);
-        String storePlugin = (String) map.get(ProductDerivations.getConfigurationKey(PROP_ABSTRACT_STORE, map));
+        String storePlugin = (String) map.get(ProductDerivations
+            .getConfigurationKey(PROP_ABSTRACT_STORE, map));
         String storeCls = Configurations.getClassName(storePlugin);
         String storeProps = Configurations.getProperties(storePlugin);
-        AbstractStoreManager store = createStoreManager(storeCls, tmp, storeProps);
+        AbstractStoreManager store = createStoreManager(storeCls,
+            storeProps);
 
         // populate configuration
         OpenJPAConfiguration conf = store.newConfiguration();
@@ -101,7 +106,8 @@ public class AbstractStoreBrokerFactory
         conf.supportedOptions().removeAll(store.getUnsupportedOptions());
 
         // create and pool a new factory
-        return new AbstractStoreBrokerFactory(conf, storeCls, storeProps, store.getPlatform());
+        return new AbstractStoreBrokerFactory(conf, storeCls, storeProps,
+            store.getPlatform());
     }
 
     /**
@@ -122,13 +128,17 @@ public class AbstractStoreBrokerFactory
     }
 
     protected StoreManager newStoreManager() {
-        return createStoreManager(_storeCls, new OpenJPAConfigurationImpl(), _storeProps);
+        return createStoreManager(_storeCls, _storeProps);
     }
 
-    private static AbstractStoreManager createStoreManager(String cls, OpenJPAConfiguration conf, String props) {
+    private static AbstractStoreManager createStoreManager(String cls,
+        String props) {
         AbstractStoreManager store =
-            (AbstractStoreManager) Configurations.newInstance(cls, conf, props); 
-        Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE);
+            (AbstractStoreManager) Configurations.newInstance(cls,
+                AccessController.doPrivileged(J2DoPrivHelper
+                    .getClassLoaderAction(AbstractStoreManager.class))); 
+        Configurations.configureInstance(store, null, props,
+            PROP_ABSTRACT_STORE);
         if (store == null)
             throw new UserException(s_loc.get("no-store-manager",
                 PROP_ABSTRACT_STORE)).setFatal(true);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/abstractstore/AbstractStoreManager.java Sat Nov  5 17:17:26 2011
@@ -244,7 +244,7 @@ public abstract class AbstractStoreManag
      * states, and delegates to
      * {@link #flush(Collection,Collection,Collection,Collection,Collection)}.
      */
-    public Collection<Exception> flush(Collection<? extends OpenJPAStateManager> sms) {
+    public Collection<Exception> flush(Collection<OpenJPAStateManager> sms) {
         // break down state managers by state; initialize as empty lists;
         // use constants for efficiency
         Collection<OpenJPAStateManager> pNew = new LinkedList<OpenJPAStateManager>();

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/ApplicationIdToolTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/ApplicationIdToolTask.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/ApplicationIdToolTask.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/ApplicationIdToolTask.java Sat Nov  5 17:17:26 2011
@@ -104,7 +104,9 @@ public class ApplicationIdToolTask
 
     protected void executeOn(String[] files)
         throws IOException, ClassNotFoundException {
-        flags.directory = (dirName == null) ? null : Files.getFile(dirName, getClassLoader());
-        ApplicationIdTool.run((OpenJPAConfiguration) getConfiguration(), files, flags);
+        flags.directory = (dirName == null) ? null
+            : Files.getFile(dirName, getClassLoader());
+        ApplicationIdTool.run((OpenJPAConfiguration) getConfiguration(), files,
+            flags, getClassLoader ());
 	}
 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java Sat Nov  5 17:17:26 2011
@@ -86,6 +86,6 @@ public class PCEnhancerTask
             : Files.getFile(dirName, getClassLoader());
         OpenJPAConfiguration conf = (OpenJPAConfiguration) getConfiguration();
         MetaDataRepository repos = conf.newMetaDataRepositoryInstance();
-        PCEnhancer.run(conf, files, flags, repos, null);
+        PCEnhancer.run(conf, files, flags, repos, null, getClassLoader ());
 	}
 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/AutoDetachValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/AutoDetachValue.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/AutoDetachValue.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/AutoDetachValue.java Sat Nov  5 17:17:26 2011
@@ -58,6 +58,10 @@ class AutoDetachValue
         setAliasListComprehensive(true);
     }
 
+    public Class getValueType() {
+        return String[].class;
+    }
+
     public void setConstant(int flags) {
         _flags = flags;
     }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerFactoryValue.java Sat Nov  5 17:17:26 2011
@@ -23,7 +23,6 @@ import java.util.Map;
 import java.util.Iterator;
 
 import org.apache.openjpa.abstractstore.AbstractStoreBrokerFactory;
-import org.apache.openjpa.kernel.Broker;
 import org.apache.openjpa.kernel.BrokerFactory;
 import org.apache.openjpa.lib.conf.ConfigurationProvider;
 import org.apache.openjpa.lib.conf.PluginValue;
@@ -39,7 +38,7 @@ import org.apache.openjpa.lib.conf.Produ
  * @nojavadoc
  */
 public class BrokerFactoryValue
-    extends PluginValue<BrokerFactory> {
+    extends PluginValue {
 
     public static final String KEY = "BrokerFactory";
 
@@ -79,7 +78,7 @@ public class BrokerFactoryValue
     }
 
     public BrokerFactoryValue() {
-        super(BrokerFactory.class, KEY, false);
+        super(KEY, false);
         setAliases(_aliases);
     }
 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/BrokerValue.java Sat Nov  5 17:17:26 2011
@@ -18,10 +18,10 @@
  */
 package org.apache.openjpa.conf;
 
+import org.apache.openjpa.lib.conf.PluginValue;
+import org.apache.openjpa.lib.conf.Configuration;
 import org.apache.openjpa.kernel.BrokerImpl;
 import org.apache.openjpa.kernel.FinalizingBrokerImpl;
-import org.apache.openjpa.lib.conf.Configuration;
-import org.apache.openjpa.lib.conf.PluginValue;
 import org.apache.openjpa.util.InternalException;
 
 /**
@@ -31,7 +31,7 @@ import org.apache.openjpa.util.InternalE
  * @since 0.9.7
  */
 public class BrokerValue 
-    extends PluginValue<BrokerImpl> {
+    extends PluginValue {
 
     public static final String KEY = "BrokerImpl";
     public static final String NON_FINALIZING_ALIAS = "non-finalizing";
@@ -40,7 +40,7 @@ public class BrokerValue 
     private BrokerImpl _templateBroker;
 
     public BrokerValue() {
-        super(BrokerImpl.class, KEY, false);
+        super(KEY, false);
         String[] aliases = new String[] {
             DEFAULT_ALIAS, FinalizingBrokerImpl.class.getName(),
             NON_FINALIZING_ALIAS, BrokerImpl.class.getName(), 
@@ -50,29 +50,34 @@ public class BrokerValue 
         setString(aliases[0]);        
     }
 
-    public BrokerImpl newInstance(String clsName, Configuration conf,  boolean fatal) {
-        getTemplateBroker(clsName, conf, fatal);
+    public Object newInstance(String clsName, Class type, Configuration conf,
+        boolean fatal) {
+        getTemplateBroker(clsName, type, conf, fatal);
 
         try {
-            return (BrokerImpl)_templateBroker.clone();
+            return _templateBroker.clone();
         } catch (CloneNotSupportedException e) {
             throw new InternalException(e);
         }
     }
 
     public Class<? extends BrokerImpl> getTemplateBrokerType(Configuration c) {
-        return getTemplateBroker(getClassName(), c, true).getClass();
+        return getTemplateBroker(getClassName(), BrokerImpl.class, c, true)
+            .getClass();
     }
 
-    private BrokerImpl getTemplateBroker(String clsName, Configuration conf, boolean fatal) {
+    private BrokerImpl getTemplateBroker(String clsName, Class type,
+        Configuration conf, boolean fatal) {
         if (clsName == null || !clsName.equals(getClassName()))
-            throw new IllegalArgumentException("clsName != configured value '" + getClassName() + "'");
+            throw new IllegalArgumentException("clsName != configured value '"
+                + getClassName() + "'");
 
         // This is not synchronized. If there are concurrent invocations
         // while _templateBroker is null, we'll just end up with extra
         // template brokers, which will get safely garbage collected.
         if (_templateBroker == null)
-            _templateBroker = super.newInstance(clsName, conf, fatal);
+            _templateBroker = (BrokerImpl) super.newInstance(clsName, type,
+                conf, fatal);
         return _templateBroker;
     }
 }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallerImpl.java Sat Nov  5 17:17:26 2011
@@ -182,7 +182,8 @@ public class CacheMarshallerImpl
         throws InstantiationException, IllegalAccessException {
         String name = Configurations.getClassName(policy);
         String props = Configurations.getProperties(policy);
-        _validationPolicy = (ValidationPolicy) Configurations.newInstance(name, _conf, props);
+        _validationPolicy = (ValidationPolicy)
+            Configurations.newInstance(name, _conf, props, null);
     }
 
     public ValidationPolicy getValidationPolicy() {
@@ -217,7 +218,8 @@ public class CacheMarshallerImpl
 
     private void setInputUrlFromResourceLocation() {
         try {
-            ClassLoader cl = _conf.getClassLoader();
+            ClassLoader cl = _conf.getClassResolverInstance()
+                .getClassLoader(getClass(), null);
             List list = new ArrayList();
             for (Enumeration e = cl.getResources(_inputResourceLocation);
                 e.hasMoreElements(); )

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallersValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallersValue.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallersValue.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/CacheMarshallersValue.java Sat Nov  5 17:17:26 2011
@@ -32,28 +32,33 @@ import org.apache.openjpa.lib.conf.Confi
  *
  * @since 1.1.0
  */
-public class CacheMarshallersValue extends PluginListValue<CacheMarshaller> {
+public class CacheMarshallersValue
+    extends PluginListValue {
 
     private static final String KEY = "CacheMarshallers";
-    private static final CacheMarshaller NO_OP_CACHE_MARSHALLER = new NoOpCacheMarshaller();
-    private static final Localizer _loc = Localizer.forPackage(CacheMarshallersValue.class);
+    private static final CacheMarshaller NO_OP_CACHE_MARSHALLER
+        = new NoOpCacheMarshaller();
+    private static final Localizer _loc =
+        Localizer.forPackage(CacheMarshallersValue.class);
 
     private Configuration _conf;
     private Map<String,CacheMarshaller> _marshallers;
     private boolean _initialized;
 
     public CacheMarshallersValue(Configuration conf) {
-        super(CacheMarshaller[].class, KEY);
+        super(KEY);
         _conf = conf;
         setAlias("default", CacheMarshallerImpl.class.getName());
-        setAlias("none", (String)null);
+        setAlias("none", null);
         setDefault("none");
         setString("none");
         setScope(getClass());
     }
 
-    public CacheMarshaller[] instantiate(Configuration conf, boolean fatal) {
-        CacheMarshaller[] ms = super.instantiate(conf, fatal);
+    public Object instantiate(Class<?> elemType, Configuration conf,
+        boolean fatal) {
+        CacheMarshaller[] ms = (CacheMarshaller[])
+            super.instantiate(elemType, conf, fatal);
         if (ms != null) {
             _marshallers = new HashMap<String,CacheMarshaller>();
             for (int i = 0; i < ms.length; i++) {
@@ -109,7 +114,7 @@ public class CacheMarshallersValue exten
 
     protected synchronized void initialize() {
         if (!_initialized) {
-            instantiate(_conf);
+            instantiate(CacheMarshaller.class, _conf);
             _initialized = true;
         }
     }

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataCacheMaintenance.java Sat Nov  5 17:17:26 2011
@@ -18,7 +18,6 @@
  */
 package org.apache.openjpa.conf;
 
-import java.security.AccessController;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
@@ -27,7 +26,6 @@ import org.apache.openjpa.kernel.Bootstr
 import org.apache.openjpa.kernel.Broker;
 import org.apache.openjpa.kernel.BrokerFactory;
 import org.apache.openjpa.kernel.Query;
-import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Options;
 import org.apache.openjpa.lib.log.Log;
 import org.apache.openjpa.lib.conf.MapConfigurationProvider;
@@ -53,11 +51,14 @@ public class MetaDataCacheMaintenance {
     public static void main(String[] args) {
         Options opts = new Options();
         args = opts.setFromCmdLine(args);
-        boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath", true);
+        boolean devpath = opts.getBooleanProperty("scanDevPath", "ScanDevPath",
+            true);
+
         ConfigurationProvider cp = new MapConfigurationProvider(opts);
-        BrokerFactory factory = Bootstrap.newBrokerFactory(cp);
+        BrokerFactory factory = Bootstrap.newBrokerFactory(cp, null);
         try {
-            MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(factory, devpath);
+            MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
+                factory, devpath);
 
             if (args.length != 1) {
                 usage();
@@ -114,9 +115,9 @@ public class MetaDataCacheMaintenance {
     public void store() {
         MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
         repos.setSourceMode(MetaDataRepository.MODE_ALL);
-        Collection types = repos.loadPersistentTypes(devpath);
+        Collection types = repos.loadPersistentTypes(devpath, null);
         for (Iterator iter = types.iterator(); iter.hasNext(); )
-            repos.getMetaData((Class) iter.next(), true);
+            repos.getMetaData((Class) iter.next(), null, true);
 
         loadQueries();
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataRepositoryValue.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataRepositoryValue.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataRepositoryValue.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/MetaDataRepositoryValue.java Sat Nov  5 17:17:26 2011
@@ -32,12 +32,12 @@ import org.apache.openjpa.meta.MetaDataR
  * @since 1.1.0
  */
 public class MetaDataRepositoryValue
-    extends PluginValue<MetaDataRepository> {
+    extends PluginValue {
 
     private static final String KEY = "MetaDataRepository";
 
     public MetaDataRepositoryValue() {
-        super(MetaDataRepository.class, KEY, false);
+        super(KEY, false);
         String[] aliases = new String[] {
             "default",
             MetaDataRepository.class.getName()
@@ -47,7 +47,7 @@ public class MetaDataRepositoryValue
         setString(aliases[0]);
     }
 
-    public MetaDataRepository instantiate(Configuration c, boolean fatal) {
+    public Object instantiate(Class type, Configuration c, boolean fatal) {
         MetaDataRepository repos = null;
         OpenJPAConfiguration conf = (OpenJPAConfiguration) c;
 
@@ -64,7 +64,10 @@ public class MetaDataRepositoryValue
                 conf.getQueryCompilationCacheInstance().putAll((Map) os[1]);
         }
 
-        return (repos == null) ? super.instantiate(c, fatal) : repos;
+        if (repos == null)
+            return super.instantiate(type, c, fatal);
+        else
+            return repos;
     }
 
 

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java?rev=1197994&r1=1197993&r2=1197994&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java Sat Nov  5 17:17:26 2011
@@ -21,6 +21,7 @@ package org.apache.openjpa.conf;
 import java.util.Collection;
 import java.util.Map;
 
+import org.apache.openjpa.kernel.AuditManager;
 import org.apache.openjpa.audit.Auditor;
 import org.apache.openjpa.datacache.CacheDistributionPolicy;
 import org.apache.openjpa.datacache.DataCache;
@@ -57,7 +58,6 @@ import org.apache.openjpa.meta.MetaDataR
 import org.apache.openjpa.util.ClassResolver;
 import org.apache.openjpa.util.ProxyManager;
 import org.apache.openjpa.util.StoreFacadeTypeRegistry;
-import org.apache.openjpa.validation.Validator;
 
 /**
  * Defines the properties necessary to configure runtime properties and
@@ -270,23 +270,23 @@ public interface OpenJPAConfiguration
      * The plugin string for the {@link ClassResolver} to use for custom
      * class loading.
      */
-//    public String getClassResolver();
+    public String getClassResolver();
 
     /**
      * The plugin string for the {@link ClassResolver} to use for custom
      * class loading.
      */
-//    public void setClassResolver(String classResolver);
+    public void setClassResolver(String classResolver);
 
     /**
      * The {@link ClassResolver} to use.
      */
-//    public ClassResolver getClassResolverInstance();
+    public ClassResolver getClassResolverInstance();
 
     /**
      * The {@link ClassResolver} to use.
      */
-//    public void setClassResolver(ClassResolver classResolver);
+    public void setClassResolver(ClassResolver classResolver);
 
     /**
      * The {@link BrokerFactory} class to use.
@@ -1701,7 +1701,7 @@ public interface OpenJPAConfiguration
      *
      * @since 2.0.0
      */
-    public Validator getValidatorInstance();
+    public Object getValidatorInstance();
 
     /**
      * Set the container or application provided Validator instance.
@@ -1709,7 +1709,7 @@ public interface OpenJPAConfiguration
      *
      * @since 2.0.0
      */
-    public void setValidatorInstance(Validator val);
+    public void setValidatorInstance(Object val);
     
     /**
      * Gets the lifecycle event manager instance classname.
@@ -1786,7 +1786,7 @@ public interface OpenJPAConfiguration
      * 
      * @return EncryptionProvider
      */
-    public EncryptionProvider getEncryptionProviderInstance();
+    public EncryptionProvider getEncryptionProvider();
     
     
     /**



Mime
View raw message