openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1190716 [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, 29 Oct 2011 00:44:18 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 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, null))
+                if (!io.drop(cls, _mode))
                     _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(null);
+            seq = smd.getInstance();
         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(null);
+                seq = smd.getInstance();
                 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, null, false);
+        ClassMapping mapping = repos.getMapping(cls, 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, null, false);
+            mapping = repos.getMapping(cls, false);
         } catch (Exception e) {
         }
 
@@ -985,8 +985,7 @@ public class MappingTool
             opts.setProperty("schemas", schemas);
 
         Configurations.populateConfiguration(conf, opts);
-        ClassLoader loader = conf.getClassResolverInstance().
-            getClassLoader(MappingTool.class, null);
+        ClassLoader loader = conf.getClassLoader();
         if (flags.meta && ACTION_ADD.equals(flags.action))
             flags.metaDataFile = Files.getFile(fileName, loader);
         else
@@ -1022,13 +1021,12 @@ public class MappingTool
             if (ACTION_IMPORT.equals(flags.action))
                 return false;
             log.info(_loc.get("running-all-classes"));
-            classes = conf.getMappingRepositoryInstance().
-                loadPersistentTypes(true, loader);
+            classes = conf.getMappingRepositoryInstance().loadPersistentTypes(true);
         } else {
             classes = new HashSet<Class<?>>();
             ClassArgParser classParser = conf.getMetaDataRepositoryInstance().
                 getMetaDataFactory().newClassArgParser();
-            classParser.setClassLoader(loader);
+            classParser.setClassLoader(conf.getClassLoader());
             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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -45,28 +45,17 @@ 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, OpenJPAConfiguration conf) {
+    public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, boolean strict) {
         super(meta);
         _map = map;
-
-        if(conf.getCompatibilityInstance().getMetaFactoriesAreStrict()) {
-            meta.setStrict(true);
-            map.setStrict(true);
-        }
+        meta.setStrict(strict);
+        map.setStrict(strict);        
     }
 
     /**
@@ -104,40 +93,37 @@ public class MetaDataPlusMappingFactory
         // always in strict mode
     }
 
-    public void load(Class cls, int mode, ClassLoader envLoader) {
+    public void load(Class cls, int mode) {
         if ((mode & ~MODE_MAPPING) != MODE_NONE)
-            super.load(cls, mode & ~MODE_MAPPING, envLoader);
+            super.load(cls, mode & ~MODE_MAPPING);
         if (cls != null && (mode & MODE_MAPPING) != 0)
-            _map.load(cls, mode & ~MODE_META, envLoader);
+            _map.load(cls, mode & ~MODE_META);
     }
 
     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, ClassLoader envLoader) {
+    public boolean drop(Class[] cls, int mode) {
         boolean drop = true;
         if ((mode & ~MODE_MAPPING) != MODE_NONE)
-            drop &= super.drop(cls, mode & ~MODE_MAPPING, envLoader);
+            drop &= super.drop(cls, mode & ~MODE_MAPPING);
         if ((mode & MODE_MAPPING) != 0)
-            drop &= _map.drop(cls, mode & ~MODE_META, envLoader);
+            drop &= _map.drop(cls, mode & ~MODE_META);
         return drop;
     }
 
-    public Set getPersistentTypeNames(boolean classpath,
-        ClassLoader envLoader) {
-        Set names = super.getPersistentTypeNames(classpath, envLoader);
+    public Set getPersistentTypeNames(boolean classpath) {
+        Set names = super.getPersistentTypeNames(classpath);
         if (names != null && !names.isEmpty())
             return names;
-        return _map.getPersistentTypeNames(classpath, envLoader);
+        return _map.getPersistentTypeNames(classpath);
     }
 
     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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -282,7 +282,7 @@ public class QueryResultMapping
          */
         public ClassMapping getCandidateTypeMapping() {
             if (_candidateMap == null)
-                _candidateMap = _repos.getMapping(_candidate, null, true);
+                _candidateMap = _repos.getMapping(_candidate, 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -1652,9 +1652,7 @@ public class ReverseMappingTool
                     propNames[propNames.length - 1]));
 
             if (typeSpec != null)
-                type = Strings.toClass(typeSpec, _conf.
-                    getClassResolverInstance().getClassLoader
-                    (ReverseMappingTool.class, null));
+                type = Strings.toClass(typeSpec, _conf.getClassLoader());
         }
 
         if (type == null)
@@ -1943,15 +1941,12 @@ public class ReverseMappingTool
 
         // setup a configuration instance with cmd-line info
         Configurations.populateConfiguration(conf, opts);
-        ClassLoader loader = conf.getClassResolverInstance().
-            getClassLoader(ReverseMappingTool.class, null);
+        ClassLoader loader = conf.getClassLoader();
 
         // customizer
-        flags.customizer = (ReverseCustomizer) Configurations.
-            newInstance(customCls, loader);
+        flags.customizer = (ReverseCustomizer) Configurations.newInstance(customCls, conf, customOpts);
         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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -62,7 +62,7 @@ public class ClassNameDiscriminatorStrat
 
     protected Class getClass(Object val, JDBCStore store)
         throws ClassNotFoundException {
-        ClassLoader loader = getClassLoader(store);
+        ClassLoader loader = store.getConfiguration().getClassLoader();
         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 = getClassLoader(store);
+        ClassLoader loader = store.getConfiguration().getClassLoader();
         Connection conn = store.getConnection();
         PreparedStatement stmnt = null;
         ResultSet rs = null;
@@ -119,12 +119,4 @@ 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -87,8 +87,7 @@ public class RelationStrategies {
         } else if (val.getClass() == vm.getType())
             rel = vm.getTypeMapping(); // common case
         else {
-            rel = vm.getMappingRepository().getMapping(val.getClass(),
-                store.getContext().getClassLoader(), true);
+            rel = vm.getMappingRepository().getMapping(val.getClass(), 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -113,9 +113,7 @@ public class UntypedPCValueHandler
         String oidStr = str.substring(idx + 1);
 
         StoreContext ctx = store.getContext();
-        ClassLoader loader = store.getConfiguration().
-            getClassResolverInstance().getClassLoader(vm.getType(),
-            ctx.getClassLoader());
+        ClassLoader loader = store.getConfiguration().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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -99,8 +99,7 @@ extends SimpleDriverDataSource implement
             if (_ds == null) {
                 try {
                     Properties dbcpProps = updateDBCPProperties(props);
-                    _ds = (DataSource) Configurations.newInstance(DBCPBASICDATASOURCENAME, conf,
-                        dbcpProps, getClassLoader());
+                    _ds = (DataSource) Configurations.newInstance(DBCPBASICDATASOURCENAME, conf, dbcpProps);
                 } 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -66,18 +66,13 @@ 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.getClassResolverInstance().
-            getClassLoader(DataSourceFactory.class, null);
-        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.getClassLoader();
+        String props = (factory2) ? conf.getConnection2Properties() : conf.getConnectionProperties();
         try {
             Class<?> driverClass;
             try {
@@ -113,10 +108,7 @@ 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, AccessController.doPrivileged(
-                        J2DoPrivHelper.getClassLoaderAction(
-                            DataSource.class))); 
+                return (DataSource) Configurations.newInstance(driver, conf, props); 
             }
         }
         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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -21,13 +21,12 @@ 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;
 
 /**
@@ -40,7 +39,6 @@ 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
@@ -68,8 +66,6 @@ public class FileSchemaFactory
 
     public void setConfiguration(Configuration conf) {
         _conf = (JDBCConfiguration) conf;
-        _loader = _conf.getClassResolverInstance().
-            getClassLoader(getClass(), null);
     }
 
     public void startConfiguration() {
@@ -79,8 +75,7 @@ public class FileSchemaFactory
     }
 
     public SchemaGroup readSchema() {
-        URL url = AccessController.doPrivileged(
-            J2DoPrivHelper.getResourceAction(_loader, _fileName)); 
+        URL url = _conf.getClassLoader().getResource(_fileName); 
         if (url == null)
             return new SchemaGroup();
 
@@ -94,11 +89,11 @@ public class FileSchemaFactory
     }
 
     public void storeSchema(SchemaGroup schema) {
-        File file = Files.getFile(_fileName, _loader);
+        File file = Files.getFile(_fileName, _conf.getClassLoader());
         XMLSchemaSerializer ser = new XMLSchemaSerializer(_conf);
         ser.addAll(schema);
         try {
-            ser.serialize(file, ser.PRETTY);
+            ser.serialize(file, MetaDataSerializer.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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -1423,8 +1423,7 @@ public class SchemaTool {
         Configurations.populateConfiguration(conf, opts);
 
         // create script writer
-        ClassLoader loader = conf.getClassResolverInstance().
-            getClassLoader(SchemaTool.class, null);
+        ClassLoader loader = conf.getClassLoader();
         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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -124,6 +124,7 @@ 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -1223,9 +1223,7 @@ public class OracleDictionary
         if (EMPTY_CLOB != null)
             return EMPTY_CLOB;
         try {
-            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, 
-                    AccessController.doPrivileged(J2DoPrivHelper
-                            .getContextClassLoaderAction())).
+            return EMPTY_CLOB = (Clob) Class.forName("oracle.sql.CLOB",true, conf.getClassLoader()).
                 getMethod("empty_lob", new Class[0]).
                 invoke(null, new Object[0]);
         } catch (Exception e) {
@@ -1238,9 +1236,7 @@ public class OracleDictionary
         if (EMPTY_BLOB != null)
             return EMPTY_BLOB;
         try {
-            return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB",true, 
-                    AccessController.doPrivileged(J2DoPrivHelper
-                            .getContextClassLoaderAction())).
+            return EMPTY_BLOB = (Blob) Class.forName("oracle.sql.BLOB",true, conf.getClassLoader()).
                 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -920,12 +920,9 @@ public class PostgresDictionary
         try {
             if (dbcpGetDelegate == null) {
                 Class<?> dbcpConnectionClass =
-                    Class.forName("org.apache.commons.dbcp.DelegatingConnection", true, AccessController
-                        .doPrivileged(J2DoPrivHelper.getContextClassLoaderAction()));
+                    Class.forName("org.apache.commons.dbcp.DelegatingConnection", true, conf.getClassLoader());
                 Class<?> poolingDataSource = Class.forName(
-                        "org.apache.commons.dbcp.PoolingDataSource", true,
-                        AccessController.doPrivileged(J2DoPrivHelper
-                                .getContextClassLoaderAction()));
+                        "org.apache.commons.dbcp.PoolingDataSource", true, conf.getClassLoader());
                 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -213,7 +213,7 @@ public class JESTContext implements JPAS
     
     public ClassMetaData resolve(String alias) {
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        return _repos.getMetaData(alias, loader, true);
+        return _repos.getMetaData(alias, 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -18,19 +18,17 @@
  */
 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.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;
 
@@ -71,8 +69,7 @@ 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);
@@ -88,8 +85,7 @@ 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();
@@ -97,8 +93,7 @@ public class AbstractStoreBrokerFactory
             .getConfigurationKey(PROP_ABSTRACT_STORE, map));
         String storeCls = Configurations.getClassName(storePlugin);
         String storeProps = Configurations.getProperties(storePlugin);
-        AbstractStoreManager store = createStoreManager(storeCls,
-            storeProps);
+        AbstractStoreManager store = createStoreManager(storeCls, storeProps);
 
         // populate configuration
         OpenJPAConfiguration conf = store.newConfiguration();
@@ -131,14 +126,10 @@ public class AbstractStoreBrokerFactory
         return createStoreManager(_storeCls, _storeProps);
     }
 
-    private static AbstractStoreManager createStoreManager(String cls,
-        String props) {
+    private static AbstractStoreManager createStoreManager(String cls, String props) {
         AbstractStoreManager store =
-            (AbstractStoreManager) Configurations.newInstance(cls,
-                AccessController.doPrivileged(J2DoPrivHelper
-                    .getClassLoaderAction(AbstractStoreManager.class))); 
-        Configurations.configureInstance(store, null, props,
-            PROP_ABSTRACT_STORE);
+            (AbstractStoreManager) Configurations.newInstance(cls, (Configuration)null, props); 
+        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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 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<OpenJPAStateManager> sms) {
+    public Collection<Exception> flush(Collection<? extends 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -104,9 +104,7 @@ 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, getClassLoader ());
+        flags.directory = (dirName == null) ? null : Files.getFile(dirName, getClassLoader());
+        ApplicationIdTool.run((OpenJPAConfiguration) getConfiguration(), files, flags);
 	}
 }

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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 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, getClassLoader ());
+        PCEnhancer.run(conf, files, flags, repos, null);
 	}
 }

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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -58,10 +58,6 @@ 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -23,6 +23,7 @@ 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;
@@ -38,7 +39,7 @@ import org.apache.openjpa.lib.conf.Produ
  * @nojavadoc
  */
 public class BrokerFactoryValue
-    extends PluginValue {
+    extends PluginValue<BrokerFactory> {
 
     public static final String KEY = "BrokerFactory";
 
@@ -78,7 +79,7 @@ public class BrokerFactoryValue
     }
 
     public BrokerFactoryValue() {
-        super(KEY, false);
+        super(BrokerFactory.class, 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 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 {
+    extends PluginValue<BrokerImpl> {
 
     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(KEY, false);
+        super(BrokerImpl.class, KEY, false);
         String[] aliases = new String[] {
             DEFAULT_ALIAS, FinalizingBrokerImpl.class.getName(),
             NON_FINALIZING_ALIAS, BrokerImpl.class.getName(), 
@@ -50,34 +50,29 @@ public class BrokerValue 
         setString(aliases[0]);        
     }
 
-    public Object newInstance(String clsName, Class type, Configuration conf,
-        boolean fatal) {
-        getTemplateBroker(clsName, type, conf, fatal);
+    public BrokerImpl newInstance(String clsName, Configuration conf,  boolean fatal) {
+        getTemplateBroker(clsName, conf, fatal);
 
         try {
-            return _templateBroker.clone();
+            return (BrokerImpl)_templateBroker.clone();
         } catch (CloneNotSupportedException e) {
             throw new InternalException(e);
         }
     }
 
     public Class<? extends BrokerImpl> getTemplateBrokerType(Configuration c) {
-        return getTemplateBroker(getClassName(), BrokerImpl.class, c, true)
-            .getClass();
+        return getTemplateBroker(getClassName(), c, true).getClass();
     }
 
-    private BrokerImpl getTemplateBroker(String clsName, Class type,
-        Configuration conf, boolean fatal) {
+    private BrokerImpl getTemplateBroker(String clsName, 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 = (BrokerImpl) super.newInstance(clsName, type,
-                conf, fatal);
+            _templateBroker = super.newInstance(clsName, 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -182,8 +182,7 @@ public class CacheMarshallerImpl
         throws InstantiationException, IllegalAccessException {
         String name = Configurations.getClassName(policy);
         String props = Configurations.getProperties(policy);
-        _validationPolicy = (ValidationPolicy)
-            Configurations.newInstance(name, _conf, props, null);
+        _validationPolicy = (ValidationPolicy) Configurations.newInstance(name, _conf, props);
     }
 
     public ValidationPolicy getValidationPolicy() {
@@ -218,8 +217,7 @@ public class CacheMarshallerImpl
 
     private void setInputUrlFromResourceLocation() {
         try {
-            ClassLoader cl = _conf.getClassResolverInstance()
-                .getClassLoader(getClass(), null);
+            ClassLoader cl = _conf.getClassLoader();
             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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -32,33 +32,28 @@ import org.apache.openjpa.lib.conf.Confi
  *
  * @since 1.1.0
  */
-public class CacheMarshallersValue
-    extends PluginListValue {
+public class CacheMarshallersValue extends PluginListValue<CacheMarshaller> {
 
     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(KEY);
+        super(CacheMarshaller[].class, KEY);
         _conf = conf;
         setAlias("default", CacheMarshallerImpl.class.getName());
-        setAlias("none", null);
+        setAlias("none", (String)null);
         setDefault("none");
         setString("none");
         setScope(getClass());
     }
 
-    public Object instantiate(Class<?> elemType, Configuration conf,
-        boolean fatal) {
-        CacheMarshaller[] ms = (CacheMarshaller[])
-            super.instantiate(elemType, conf, fatal);
+    public CacheMarshaller[] instantiate(Configuration conf, boolean fatal) {
+        CacheMarshaller[] ms = super.instantiate(conf, fatal);
         if (ms != null) {
             _marshallers = new HashMap<String,CacheMarshaller>();
             for (int i = 0; i < ms.length; i++) {
@@ -114,7 +109,7 @@ public class CacheMarshallersValue
 
     protected synchronized void initialize() {
         if (!_initialized) {
-            instantiate(CacheMarshaller.class, _conf);
+            instantiate(_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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.openjpa.conf;
 
+import java.security.AccessController;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
@@ -26,6 +27,7 @@ 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;
@@ -51,14 +53,11 @@ 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, null);
+        BrokerFactory factory = Bootstrap.newBrokerFactory(cp);
         try {
-            MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(
-                factory, devpath);
+            MetaDataCacheMaintenance maint = new MetaDataCacheMaintenance(factory, devpath);
 
             if (args.length != 1) {
                 usage();
@@ -115,9 +114,9 @@ public class MetaDataCacheMaintenance {
     public void store() {
         MetaDataRepository repos = conf.getMetaDataRepositoryInstance();
         repos.setSourceMode(MetaDataRepository.MODE_ALL);
-        Collection types = repos.loadPersistentTypes(devpath, null);
+        Collection types = repos.loadPersistentTypes(devpath);
         for (Iterator iter = types.iterator(); iter.hasNext(); )
-            repos.getMetaData((Class) iter.next(), null, true);
+            repos.getMetaData((Class) iter.next(), 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -32,12 +32,12 @@ import org.apache.openjpa.meta.MetaDataR
  * @since 1.1.0
  */
 public class MetaDataRepositoryValue
-    extends PluginValue {
+    extends PluginValue<MetaDataRepository> {
 
     private static final String KEY = "MetaDataRepository";
 
     public MetaDataRepositoryValue() {
-        super(KEY, false);
+        super(MetaDataRepository.class, KEY, false);
         String[] aliases = new String[] {
             "default",
             MetaDataRepository.class.getName()
@@ -47,7 +47,7 @@ public class MetaDataRepositoryValue
         setString(aliases[0]);
     }
 
-    public Object instantiate(Class type, Configuration c, boolean fatal) {
+    public MetaDataRepository instantiate(Configuration c, boolean fatal) {
         MetaDataRepository repos = null;
         OpenJPAConfiguration conf = (OpenJPAConfiguration) c;
 
@@ -64,10 +64,7 @@ public class MetaDataRepositoryValue
                 conf.getQueryCompilationCacheInstance().putAll((Map) os[1]);
         }
 
-        if (repos == null)
-            return super.instantiate(type, c, fatal);
-        else
-            return repos;
+        return (repos == null) ? super.instantiate(c, fatal) : 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=1190716&r1=1190715&r2=1190716&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 Oct 29 00:44:11 2011
@@ -21,7 +21,6 @@ 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;
@@ -58,6 +57,7 @@ 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 Object getValidatorInstance();
+    public Validator getValidatorInstance();
 
     /**
      * Set the container or application provided Validator instance.
@@ -1709,7 +1709,7 @@ public interface OpenJPAConfiguration
      *
      * @since 2.0.0
      */
-    public void setValidatorInstance(Object val);
+    public void setValidatorInstance(Validator val);
     
     /**
      * Gets the lifecycle event manager instance classname.
@@ -1786,7 +1786,7 @@ public interface OpenJPAConfiguration
      * 
      * @return EncryptionProvider
      */
-    public EncryptionProvider getEncryptionProvider();
+    public EncryptionProvider getEncryptionProviderInstance();
     
     
     /**



Mime
View raw message