db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/cache ObjectCacheSoftImpl.java
Date Fri, 29 Aug 2003 14:41:39 GMT
thma        2003/08/29 07:41:39

  Modified:    src/java/org/apache/ojb/broker/cache
                        ObjectCacheSoftImpl.java
  Log:
  add codeswitcher statements to the class to provide conditional compilation.
  provided a dummy implementation for JDK13 and below that trows runtime exceptions.
  
  Revision  Changes    Path
  1.2       +45 -14    db-ojb/src/java/org/apache/ojb/broker/cache/ObjectCacheSoftImpl.java
  
  Index: ObjectCacheSoftImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/cache/ObjectCacheSoftImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ObjectCacheSoftImpl.java	19 Aug 2003 18:17:28 -0000	1.1
  +++ ObjectCacheSoftImpl.java	29 Aug 2003 14:41:39 -0000	1.2
  @@ -54,24 +54,29 @@
    * <http://www.apache.org/>.
    */
   
  -// these imports are not unused.
  -import org.apache.ojb.broker.Identity;
  +//#ifdef JDBC30
   import java.lang.ref.ReferenceQueue;
   import java.lang.ref.SoftReference;
  -import java.util.*;
  +import java.util.AbstractMap;
  +import java.util.Enumeration;
  +import java.util.HashMap;
  +import java.util.LinkedHashMap;
  +import java.util.Map;
  +import java.util.Set;
  +//#else
  +/*
  +import org.apache.ojb.broker.PersistenceBrokerException;
  +*/
  +//#endif
  +import org.apache.ojb.broker.Identity;
   
   /**
  - * if you want to use the objectcachesoftimpl, uncomment the implementation.
  - * User: matthew.baird
  - * Date: Aug 19, 2003
  - * Time: 9:45:18 AM
  + * This implementation relies on JDK1.4 features like the LinkedHashMap.
  + * Thus it can not be used under JDK1.3 or below.
  + * @author matthew.baird
    */
  -public final class ObjectCacheSoftImpl
  -{
  -
  -}
  -/*
  -		implements ObjectCache
  +public final class ObjectCacheSoftImpl implements ObjectCache
  +//#ifdef JDBC30
   {
   	private final SoftHashMap m_map;
   	int m_hardSize = 100;
  @@ -261,5 +266,31 @@
   			throw new UnsupportedOperationException();
   		}
   	}
  +}
  +//#else
  +/*
  +{	
  +
  +    public void cache(Identity oid, Object obj)
  +    {
  +    	throw new PersistenceBrokerException(this.getClass().toString() + " can only be used
with JDK1.4 or higher.");
  +    }
  +
  +    public void clear()
  +    {
  +    	throw new PersistenceBrokerException(this.getClass().toString() + " can only be used
with JDK1.4 or higher.");
  +    }
  +
  +    public Object lookup(Identity oid)
  +    {
  +    	throw new PersistenceBrokerException(this.getClass().toString() + " can only be used
with JDK1.4 or higher.");
  +    }
  +
  +    public void remove(Identity oid)
  +    {
  +    	throw new PersistenceBrokerException(this.getClass().toString() + " can only be used
with JDK1.4 or higher.");
  +    }
  +}
  +*/
  +//#endif
   
  -}*/
  
  
  

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