db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/cache ObjectCacheDefaultImpl.java
Date Thu, 13 Feb 2003 19:19:21 GMT
brj         2003/02/13 11:19:21

  Modified:    src/java/org/apache/ojb/broker/cache
                        ObjectCacheDefaultImpl.java
  Log:
  use default Broker to get rid of deprecated Identity constructor
  
  Revision  Changes    Path
  1.6       +14 -3     db-ojb/src/java/org/apache/ojb/broker/cache/ObjectCacheDefaultImpl.java
  
  Index: ObjectCacheDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/ObjectCacheDefaultImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ObjectCacheDefaultImpl.java	12 Feb 2003 15:57:41 -0000	1.5
  +++ ObjectCacheDefaultImpl.java	13 Feb 2003 19:19:21 -0000	1.6
  @@ -58,6 +58,8 @@
   import java.util.Hashtable;
   
   import org.apache.ojb.broker.Identity;
  +import org.apache.ojb.broker.PersistenceBroker;
  +import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
  @@ -104,12 +106,21 @@
       }
   
       /**
  +     * Get the default Broker
  +     * @return PersistenceBroker
  +     */
  +    private PersistenceBroker getBroker()
  +    {
  +        return PersistenceBrokerFactory.defaultPersistenceBroker();
  +    }
  +    
  +    /**
        * Make object obj persistent to Objectcache.
        * compute objects identity and use it as key for the hashmap
        */
       public void cache(Object obj) throws ClassNotPersistenceCapableException
       {
  -        Identity oid = new Identity(obj);
  +        Identity oid = new Identity(obj, getBroker());
           this.cache(oid, obj);
       }
   
  @@ -187,7 +198,7 @@
               }
               else 
               {
  -                oidString = new Identity(obj).toString();
  +                oidString = new Identity(obj,getBroker()).toString();
               }
               objectTable.remove(oidString);
           }
  
  
  

Mime
View raw message