You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ar...@apache.org on 2006/08/07 19:20:18 UTC

svn commit: r429402 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java

Author: arminw
Date: Mon Aug  7 10:20:17 2006
New Revision: 429402

URL: http://svn.apache.org/viewvc?rev=429402&view=rev
Log:
allow to specify RepositoryPersistor implementation class

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java?rev=429402&r1=429401&r2=429402&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java (original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/MetadataManager.java Mon Aug  7 10:20:17 2006
@@ -136,13 +136,13 @@
     private static ThreadLocal threadedRepository = new ThreadLocal();
     private static ThreadLocal currentProfileKey = new ThreadLocal();
     private static MetadataManager singleton;
+    private static Class repositoryPersistorClass;
 
     private Hashtable metadataProfiles;
     private DescriptorRepository globalRepository;
     private ConnectionRepository connectionRepository;
     private boolean enablePerThreadChanges;
     private PBKey defaultPBKey;
-    private Class repositoryPersistorClass;
 
     // singleton
     private MetadataManager()
@@ -154,7 +154,10 @@
     {
         metadataProfiles = new Hashtable();
         Configuration conf = OjbConfigurator.getInstance().getConfigurationFor(null);
-        repositoryPersistorClass = conf.getClass("RepositoryPersistorClass", RepositoryPersistor.class);
+        if(repositoryPersistorClass == null)
+        {
+            repositoryPersistorClass = conf.getClass("RepositoryPersistorClass", RepositoryPersistor.class);
+        }
         boolean useSerializedRepository = ((MetadataConfiguration) conf).useSerializedRepository();
         File serFile = null;
         if(useSerializedRepository)
@@ -766,5 +769,15 @@
     private RepositoryPersistor createRepositoryPersistor() throws Exception
     {
         return (RepositoryPersistor) ClassHelper.newInstance(repositoryPersistorClass);
+    }
+
+    public static Class getRepositoryPersistorClass()
+    {
+        return repositoryPersistorClass;
+    }
+
+    public static void setRepositoryPersistorClass(Class repositoryPersistorClass)
+    {
+        MetadataManager.repositoryPersistorClass = repositoryPersistorClass;
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org