db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata MetadataManager.java
Date Sat, 12 Jun 2004 14:38:59 GMT
arminw      2004/06/12 07:38:59

  Modified:    src/java/org/apache/ojb/broker/metadata MetadataManager.java
  Log:
  minor change, make sure that only one instance was created
  
  Revision  Changes    Path
  1.18      +10 -16    db-ojb/src/java/org/apache/ojb/broker/metadata/MetadataManager.java
  
  Index: MetadataManager.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/MetadataManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- MetadataManager.java	27 May 2004 21:04:41 -0000	1.17
  +++ MetadataManager.java	12 Jun 2004 14:38:59 -0000	1.18
  @@ -15,19 +15,19 @@
    * limitations under the License.
    */
   
  -import org.apache.commons.lang.SerializationUtils;
  -import org.apache.ojb.broker.core.PersistenceBrokerConfiguration;
  -import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
  -import org.apache.ojb.broker.util.logging.Logger;
  -import org.apache.ojb.broker.util.logging.LoggerFactory;
  -import org.apache.ojb.broker.PBKey;
  -
   import java.io.FileNotFoundException;
   import java.io.InputStream;
   import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.List;
   
  +import org.apache.commons.lang.SerializationUtils;
  +import org.apache.ojb.broker.PBKey;
  +import org.apache.ojb.broker.core.PersistenceBrokerConfiguration;
  +import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
  +import org.apache.ojb.broker.util.logging.Logger;
  +import org.apache.ojb.broker.util.logging.LoggerFactory;
  +
   /**
    * Central class for metadata operations/manipulations - manages OJB's
    * metadata objects, in particular:
  @@ -123,9 +123,8 @@
       private static Logger log = LoggerFactory.getLogger(MetadataManager.class);
   
       private static final String MSG_STR = "* Can't find DescriptorRepository for current
thread, use default one *";
  -
       private static ThreadLocal threadedRepository = new ThreadLocal();
  -    private static MetadataManager singleton = null;
  +    private static MetadataManager singleton = new MetadataManager();
   
       private Hashtable metadataProfiles;
       private DescriptorRepository globalRepository;
  @@ -157,7 +156,7 @@
           }
           catch (Exception ex)
           {
  -            throw new MetadataException("Could not read repository file" + repository,
ex);
  +            throw new MetadataException("Can't read repository file '" + repository + "'",
ex);
           }
           this.defaultPBKey = buildDefaultKey();
       }
  @@ -167,11 +166,6 @@
        */
       public static MetadataManager getInstance()
       {
  -        // lazy initialization
  -        if (singleton == null)
  -        {
  -            singleton = new MetadataManager();
  -        }
           return singleton;
       }
   
  
  
  

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


Mime
View raw message