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/cache ObjectCacheDefaultImpl.java
Date Sun, 25 Sep 2005 01:45:06 GMT
arminw      2005/09/24 18:45:06

  Modified:    src/java/org/apache/ojb/broker/cache
                        ObjectCacheDefaultImpl.java
  Log:
  improve toString
  
  Revision  Changes    Path
  1.31      +23 -2     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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- ObjectCacheDefaultImpl.java	27 Aug 2005 12:06:45 -0000	1.30
  +++ ObjectCacheDefaultImpl.java	25 Sep 2005 01:45:06 -0000	1.31
  @@ -112,7 +112,8 @@
           this.ocd = ocd;
           if(ocd.getTimeout() != null)
           {
  -            timeout = ocd.getTimeout().longValue() * 1000;
  +            long value = ocd.getTimeout().longValue();
  +            timeout = value > -1 ? value * 1000 : -1;
           }
           useSoftReferences = (Boolean.valueOf((ocd.getAttribute(PROP_USE_SOFT_REFERENCES,
"true")).trim())).booleanValue();
           maxEntry = (Integer.parseInt(ocd.getAttribute(PROP_MAX_ENTRY, "-1")));
  @@ -305,6 +306,16 @@
           {
               return lifetime;
           }
  +
  +        public String toString()
  +        {
  +            return new StringBuffer("[identity=")
  +                    .append(oid)
  +                    .append(", lifetime=")
  +                    .append(lifetime)
  +                    .append(", obj=")
  +                    .append(get()).toString();
  +        }
       }
   
       class CacheEntryHard implements CacheEntry
  @@ -342,6 +353,16 @@
           {
               return lifetime;
           }
  +
  +        public String toString()
  +        {
  +            return new StringBuffer("[identity=")
  +                    .append(oid)
  +                    .append(", lifetime=")
  +                    .append(lifetime)
  +                    .append(", obj=")
  +                    .append(get()).toString();
  +        }
       }
   
   }
  
  
  

---------------------------------------------------------------------
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