You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by James Taylor <jt...@4lane.com> on 2002/02/14 13:41:04 UTC

Re: cvs commit: jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control Cache.java

Aaron,

Minor thing, but it looks like JRefactory is screwing up the formatting
of the license and javadoc. Now that it has been run once on all the
files, you should probably not run it on them again. I'll try and fix
formatting errors that creep in =] Probably this is a problem with the
JRefactory settings I gave you, I'm not an expert on that tool.

Thanks,
James

On Thu, 2002-02-14 at 00:30, asmuts@apache.org wrote:
> asmuts      02/02/13 21:30:51
> 
>   Modified:    src/java/org/apache/stratum/jcs/access TestCacheAccess.java
>                         GroupCacheAccess.java CacheAccess.java
>                src/java/org/apache/stratum/jcs/engine/memory/lru
>                         LRUMemoryCache.java
>                src/java/org/apache/stratum/jcs JCS.java
>                src/java/org/apache/stratum/jcs/access/behavior
>                         ICacheAccess.java
>                src/java/org/apache/stratum/jcs/engine/control Cache.java
>   Log:
>   removed old lateral direct methods, deprecated destroy for remove
>   created access methods to update the cache attributes for controlling memory size.
>   want to move into auxiliary configuration.  Should give a list and let them be selected or something to reduce configuration.
>   
>   Revision  Changes    Path
>   1.9       +37 -37    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java
>   
>   Index: TestCacheAccess.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java,v
>   retrieving revision 1.8
>   retrieving revision 1.9
>   diff -u -r1.8 -r1.9
>   --- TestCacheAccess.java	19 Jan 2002 06:27:12 -0000	1.8
>   +++ TestCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.9
>   @@ -158,11 +158,11 @@
>                        {
>                            help();
>                        }
>   -                    else
>   -                        if ( message.startsWith( "removeLateralDirect" ) )
>   -                    {
>   -                        removeLateralDirect( message );
>   -                    }
>   +//                    else
>   +//                        if ( message.startsWith( "removeLateralDirect" ) )
>   +//                    {
>   +//                        removeLateralDirect( message );
>   +//                    }
>                        else
>                            if ( message.startsWith( "getAttributeNames" ) )
>                        {
>   @@ -577,7 +577,7 @@
>                            if ( message.startsWith( "remove" ) )
>                        {
>                            String key = message.substring( message.indexOf( " " ) + 1, message.length() );
>   -                        cache_control.destroy( key );
>   +                        cache_control.remove( key );
>                            p( "removed " + key );
>                        }
>                        else
>   @@ -680,43 +680,43 @@
>            p( "type 'put key val' to put" );
>            p( "type 'stats' to get stats" );
>            p( "type 'cloneattr num' to clone attr" );
>   -        p( "type 'removeLateralDirect key' to remove lateral" );
>   +//        p( "type 'removeLateralDirect key' to remove lateral" );
>            p( "type 'switch number' to switch to testCache[number], 1 == testCache1" );
>            p( "type 'help' for commands" );
>    
>        }
>    
>    
>   -    ////////////////////////////////////////
>   -    /**
>   -     *  Description of the Method
>   -     *
>   -     *@param  message  Description of the Parameter
>   -     */
>   -    public static void removeLateralDirect( String message )
>   -    {
>   -
>   -        String key = null;
>   -        StringTokenizer toke = new StringTokenizer( message );
>   -        int tcnt = 0;
>   -        while ( toke.hasMoreElements() )
>   -        {
>   -            tcnt++;
>   -            String t = ( String ) toke.nextElement();
>   -            if ( tcnt == 2 )
>   -            {
>   -                key = t.trim();
>   -            }
>   -        }
>   -
>   -        if ( tcnt < 2 )
>   -        {
>   -            key = "ALL";
>   -        }
>   -
>   -        cache_control.removeLateralDirect( key );
>   -        p( "called delete multicast for key " + key );
>   -    }
>   +//    ////////////////////////////////////////
>   +//    /**
>   +//     *  Description of the Method
>   +//     *
>   +//     *@param  message  Description of the Parameter
>   +//     */
>   +//    public static void removeLateralDirect( String message )
>   +//    {
>   +//
>   +//        String key = null;
>   +//        StringTokenizer toke = new StringTokenizer( message );
>   +//        int tcnt = 0;
>   +//        while ( toke.hasMoreElements() )
>   +//        {
>   +//            tcnt++;
>   +//            String t = ( String ) toke.nextElement();
>   +//            if ( tcnt == 2 )
>   +//            {
>   +//                key = t.trim();
>   +//            }
>   +//        }
>   +//
>   +//        if ( tcnt < 2 )
>   +//        {
>   +//            key = "ALL";
>   +//        }
>   +//
>   +//        cache_control.removeLateralDirect( key );
>   +//        p( "called delete multicast for key " + key );
>   +//    }
>    
>        // end help
>    
>   
>   
>   
>   1.10      +6 -0      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java
>   
>   Index: GroupCacheAccess.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java,v
>   retrieving revision 1.9
>   retrieving revision 1.10
>   diff -u -r1.9 -r1.10
>   --- GroupCacheAccess.java	12 Feb 2002 15:47:55 -0000	1.9
>   +++ GroupCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.10
>   @@ -477,12 +477,18 @@
>         *
>         *@param  name   Description of the Parameter
>         *@param  group  Description of the Parameter
>   +     *
>   +     * @deprecated
>         */
>        public void destroy( String name, String group )
>        {
>            removeAttribute( name, group );
>        }
>    
>   +    public void remove( String name, String group )
>   +    {
>   +        removeAttribute( name, group );
>   +    }
>    
>        /////////////////////////////////////
>        /**
>   
>   
>   
>   1.7       +229 -155  jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java
>   
>   Index: CacheAccess.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java,v
>   retrieving revision 1.6
>   retrieving revision 1.7
>   diff -u -r1.6 -r1.7
>   --- CacheAccess.java	12 Feb 2002 03:16:48 -0000	1.6
>   +++ CacheAccess.java	14 Feb 2002 05:30:50 -0000	1.7
>   @@ -11,28 +11,28 @@
>     * are met:
>     *
>     * 1. Redistributions of source code must retain the above copyright
>   - *    notice, this list of conditions and the following disclaimer.
>   + * notice, this list of conditions and the following disclaimer.
>     *
>     * 2. Redistributions in binary form must reproduce the above copyright
>   - *    notice, this list of conditions and the following disclaimer in
>   - *    the documentation and/or other materials provided with the
>   - *    distribution.
>   + * notice, this list of conditions and the following disclaimer in
>   + * the documentation and/or other materials provided with the
>   + * distribution.
>     *
>     * 3. The end-user documentation included with the redistribution, if
>   - *    any, must include the following acknowlegement:
>   - *       "This product includes software developed by the
>   - *        Apache Software Foundation (http://www.apache.org/)."
>   - *    Alternately, this acknowlegement may appear in the software itself,
>   - *    if and wherever such third-party acknowlegements normally appear.
>   + * any, must include the following acknowlegement:
>   + * "This product includes software developed by the
>   + * Apache Software Foundation (http://www.apache.org/)."
>   + * Alternately, this acknowlegement may appear in the software itself,
>   + * if and wherever such third-party acknowlegements normally appear.
>     *
>     * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
>   - *    Foundation" must not be used to endorse or promote products derived
>   - *    from this software without prior written permission. For written
>   - *    permission, please contact apache@apache.org.
>   + * Foundation" must not be used to endorse or promote products derived
>   + * from this software without prior written permission. For written
>   + * permission, please contact apache@apache.org.
>     *
>     * 5. Products derived from this software may not be called "Apache"
>   - *    nor may "Apache" appear in their names without prior written
>   - *    permission of the Apache Group.
>   + * nor may "Apache" appear in their names without prior written
>   + * permission of the Apache Group.
>     *
>     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>   @@ -73,25 +73,31 @@
>    import org.apache.stratum.jcs.engine.control.CompositeCacheManager;
>    
>    /**
>   - * Class which provides interface for all access to the cache. An instance of 
>   - * this class is tied to a specific cache region. Static methods are provided
>   - * to get such instances. 
>   + *  Class which provides interface for all access to the cache. An instance of
>   + *  this class is tied to a specific cache region. Static methods are provided
>   + *  to get such instances.
>     *
>   - * @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
>   - * @version $Id: CacheAccess.java,v 1.6 2002/02/12 03:16:48 jtaylor Exp $
>   + *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
>   + *@created    February 13, 2002
>   + *@version    $Id: CacheAccess.java,v 1.7 2002/02/14 05:30:50 asmuts Exp $
>     */
>    public class CacheAccess implements ICacheAccess
>    {
>   -    /** Cache manager use by the various forms of defineRegion and getAccess */
>   +    /**
>   +     *  Cache manager use by the various forms of defineRegion and getAccess
>   +     */
>        private static CompositeCacheManager cacheMgr;
>    
>   -    /** Cache that a given instance of this class provides access to */
>   +    /**
>   +     *  Cache that a given instance of this class provides access to. Should
>   +     *  this be the inteface?
>   +     */
>        protected Cache cacheControl;
>    
>        /**
>   -     * Constructor for the CacheAccess object.
>   +     *  Constructor for the CacheAccess object.
>         *
>   -     * @param cacheControl The cache which the created instance accesses
>   +     *@param  cacheControl  The cache which the created instance accesses
>         */
>        protected CacheAccess( Cache cacheControl )
>        {
>   @@ -101,89 +107,89 @@
>        // ----------------------------- static methods for access to cache regions
>    
>        /**
>   -     * Define a new cache region with the given name.
>   -     *
>   -     * In the oracle specification, these attributes are global and not region
>   -     * specific, regional overirdes is a value add each region should be able
>   -     * to house both cache and element attribute sets. It is more efficient to
>   -     * define a cache in the props file and then strictly use the get access
>   -     * method. Use of the define region outside of an initialization block
>   -     * should be avoided.
>   -     *
>   -     * @param name Name that will identify the region
>   -     * @return CacheAccess instance for the new region
>   -     * @exception CacheException 
>   +     *  Define a new cache region with the given name. In the oracle
>   +     *  specification, these attributes are global and not region specific,
>   +     *  regional overirdes is a value add each region should be able to house
>   +     *  both cache and element attribute sets. It is more efficient to define a
>   +     *  cache in the props file and then strictly use the get access method. Use
>   +     *  of the define region outside of an initialization block should be
>   +     *  avoided.
>   +     *
>   +     *@param  name                Name that will identify the region
>   +     *@return                     CacheAccess instance for the new region
>   +     *@exception  CacheException
>         */
>        public static CacheAccess defineRegion( String name )
>            throws CacheException
>        {
>            ensureCacheManager();
>   -        
>   +
>            return new CacheAccess( ( Cache ) cacheMgr.getCache( name ) );
>        }
>    
>        /**
>   -     * Define a new cache region with the specified name and attributes.
>   +     *  Define a new cache region with the specified name and attributes.
>         *
>   -     * @param name Name that will identify the region
>   -     * @param cattr CompositeCacheAttributes for the region
>   -     * @return CacheAccess instance for the new region
>   -     * @exception CacheException 
>   +     *@param  name                Name that will identify the region
>   +     *@param  cattr               CompositeCacheAttributes for the region
>   +     *@return                     CacheAccess instance for the new region
>   +     *@exception  CacheException
>         */
>   -    public static CacheAccess defineRegion( String name, 
>   +    public static CacheAccess defineRegion( String name,
>                                                CompositeCacheAttributes cattr )
>            throws CacheException
>        {
>            ensureCacheManager();
>   -        
>   +
>            return new CacheAccess( ( Cache ) cacheMgr.getCache( name, cattr ) );
>        }
>    
>        /**
>   -     * Define a new cache region with the specified name and attributes.
>   +     *  Define a new cache region with the specified name and attributes and
>   +     *  return a CacheAccess to it.
>         *
>   -     * @param name Name that will identify the region
>   -     * @param cattr CompositeCacheAttributes for the region
>   -     * @param attr Attributes for the region
>   -     * @return CacheAccess instance for the new region
>   -     * @exception CacheException 
>   +     *@param  name                Name that will identify the region
>   +     *@param  cattr               CompositeCacheAttributes for the region
>   +     *@param  attr                Attributes for the region
>   +     *@return                     CacheAccess instance for the new region
>   +     *@exception  CacheException
>         */
>   -    public static CacheAccess defineRegion( String name, 
>   -                                            CompositeCacheAttributes cattr, 
>   +    public static CacheAccess defineRegion( String name,
>   +                                            CompositeCacheAttributes cattr,
>                                                Attributes attr )
>            throws CacheException
>        {
>            ensureCacheManager();
>   -        
>   -        return new CacheAccess( 
>   +
>   +        return new CacheAccess(
>                ( Cache ) cacheMgr.getCache( name, cattr, attr ) );
>        }
>    
>        /**
>   -     * Get a CacheAccess instance for the given region.
>   +     *  Get a CacheAccess instance for the given region.
>         *
>   -     * @param region Name that identifies the region
>   -     * @return CacheAccess instance for region
>   -     * @exception CacheException 
>   +     *@param  region              Name that identifies the region
>   +     *@return                     CacheAccess instance for region
>   +     *@exception  CacheException
>         */
>        public static CacheAccess getAccess( String region )
>            throws CacheException
>        {
>            ensureCacheManager();
>   -        
>   +
>            return new CacheAccess( ( Cache ) cacheMgr.getCache( region ) );
>        }
>    
>        /**
>   -     * Get a CacheAccess instance for the given region with the given 
>   -     * attributes.
>   +     *  Get a CacheAccess instance for the given region with the given
>   +     *  attributes.
>         *
>   -     * @param region Name that identifies the region
>   -     * @param icca 
>   -     * @return CacheAccess instance for region
>   -     * @exception CacheException 
>   +     *@param  region              Name that identifies the region
>   +     *@param  icca
>   +     *@return                     CacheAccess instance for region
>   +     *@exception  CacheException
>         */
>   -    public static CacheAccess getAccess( String region, 
>   +    public static CacheAccess getAccess( String region,
>                                             ICompositeCacheAttributes icca )
>            throws CacheException
>        {
>   @@ -193,8 +199,8 @@
>        }
>    
>        /**
>   -     * Helper method which checks to make sure the cacheMgr class field is set,
>   -     * and if not requests an instance from CacheManagerFactory.
>   +     *  Helper method which checks to make sure the cacheMgr class field is set,
>   +     *  and if not requests an instance from CacheManagerFactory.
>         */
>        protected static void ensureCacheManager()
>        {
>   @@ -209,15 +215,15 @@
>                }
>            }
>        }
>   -    
>   +
>        // ------------------------------------------------------- instance methods
>    
>        /**
>   -     * Retrieve an object from the cache region this instance provides access 
>   -     * to.
>   +     *  Retrieve an object from the cache region this instance provides access
>   +     *  to.
>         *
>   -     * @param name Key the object is stored as
>   -     * @return The object if found or null
>   +     *@param  name  Key the object is stored as
>   +     *@return       The object if found or null
>         */
>        public Object get( String name )
>        {
>   @@ -225,14 +231,38 @@
>        }
>    
>        /**
>   -     * Place a new object in the cache, associated with key name. If there is 
>   -     * currently an object associated with name in the region it is replaced. 
>   -     * Names are scoped to a region so they must be unique within the
>   -     * region they are placed. 
>   -     *
>   -     * @param name Key object will be stored with
>   -     * @param obj Object to store
>   -     * @exception CacheException
>   +     *  Place a new object in the cache, associated with key name. If there is
>   +     *  currently an object associated with name in the region an
>   +     *  ObjectExistsException is thrown. Names are scoped to a region so they
>   +     *  must be unique within the region they are placed.
>   +     *
>   +     *@param  name                Key object will be stored with
>   +     *@param  obj                 Object to store
>   +     *@exception  CacheException
>   +     */
>   +    public void putSafe( Object name, Object obj )
>   +        throws CacheException
>   +    {
>   +        try
>   +        {
>   +            cacheControl.putSafe( ( Serializable ) name, ( Serializable ) obj );
>   +        }
>   +        catch ( Exception e )
>   +        {
>   +            throw new CacheException( e );
>   +        }
>   +    }
>   +
>   +
>   +    /**
>   +     *  Place a new object in the cache, associated with key name. If there is
>   +     *  currently an object associated with name in the region it is replaced.
>   +     *  Names are scoped to a region so they must be unique within the region
>   +     *  they are placed.
>   +     *
>   +     *@param  name                Key object will be stored with
>   +     *@param  obj                 Object to store
>   +     *@exception  CacheException
>         */
>        public void put( Object name, Object obj )
>            throws CacheException
>   @@ -248,22 +278,22 @@
>        }
>    
>        /**
>   -     * Place a new object in the cache. This form allows attributes to 
>   -     * associate with the object may be specified with attr.
>   +     *  Place a new object in the cache. This form allows attributes to
>   +     *  associate with the object may be specified with attr.
>         *
>   -     * @param name Key object will be stored with
>   -     * @param obj Object to store
>   -     * @param attr Attributes to store object with
>   -     * @exception CacheException
>   +     *@param  name                Key object will be stored with
>   +     *@param  obj                 Object to store
>   +     *@param  attr                Attributes to store object with
>   +     *@exception  CacheException
>         */
>        public void put( Object name, Object obj, Attributes attr )
>            throws CacheException
>        {
>            try
>            {
>   -            cacheControl.put( ( Serializable ) name, 
>   -                              ( Serializable ) obj, 
>   -                              attr );
>   +            cacheControl.put( ( Serializable ) name,
>   +                ( Serializable ) obj,
>   +                attr );
>            }
>            catch ( Exception e )
>            {
>   @@ -272,10 +302,10 @@
>        }
>    
>        /**
>   -     * Destory the region and all objects within it. After calling this method,
>   -     * the Cache object can no longer be used as it will be closed.
>   +     *  Destory the region and all objects within it. After calling this method,
>   +     *  the Cache object can no longer be used as it will be closed.
>         *
>   -     * @exception  CacheException
>   +     *@exception  CacheException
>         */
>        public void destroy()
>            throws CacheException
>   @@ -284,41 +314,66 @@
>        }
>    
>        /**
>   -     * Invalidate all objects associated with key name, removing all references 
>   -     * to the objects from the cache.
>   +     *  Description of the Method
>         *
>   -     * @param name Key that specifies object to invalidate
>   -     * @exception CacheException
>   +     *@exception  CacheException  Description of the Exception
>         */
>   -    public void destroy( Object name )
>   +    public void remove()
>            throws CacheException
>        {
>   -        cacheControl.remove( ( Serializable ) name );
>   +        cacheControl.removeAll();
>        }
>    
>        /**
>   -     * Remove the entire region of elements from other caches specified in the 
>   -     * cache.properties file as lateral caches.
>   +     *  Invalidate all objects associated with key name, removing all references
>   +     *  to the objects from the cache.
>   +     *
>   +     *@param  name                Key that specifies object to invalidate
>   +     *@exception  CacheException
>         */
>   -    public void removeLateralDirect()
>   +    public void destroy( Object name )
>   +        throws CacheException
>        {
>   -        cacheControl.removeLateralDirect( "ALL" );
>   +        cacheControl.remove( ( Serializable ) name );
>        }
>    
>        /**
>   -     * Remove the specified element from other caches specified in in the 
>   -     * cache.properties file as lateral caches.
>   +     *  Description of the Method
>         *
>   -     * @param key Key identifying object to remove
>   +     *@param  name                Description of the Parameter
>   +     *@exception  CacheException  Description of the Exception
>         */
>   -    public void removeLateralDirect( Serializable key )
>   +    public void remove( Object name )
>   +        throws CacheException
>        {
>   -        cacheControl.removeLateralDirect( key );
>   +        cacheControl.remove( ( Serializable ) name );
>        }
>    
>   +
>   +    // TODO: rethink the point of these methods
>   +//    /**
>   +//     * Remove the entire region of elements from other caches specified in the
>   +//     * cache.properties file as lateral caches.
>   +//     */
>   +//    public void removeLateralDirect()
>   +//    {
>   +//        cacheControl.removeLateralDirect( "ALL" );
>   +//    }
>   +//
>   +//    /**
>   +//     * Remove the specified element from other caches specified in in the
>   +//     * cache.properties file as lateral caches.
>   +//     *
>   +//     * @param key Key identifying object to remove
>   +//     */
>   +//    public void removeLateralDirect( Serializable key )
>   +//    {
>   +//        cacheControl.removeLateralDirect( key );
>   +//    }
>   +
>        /**
>   -     * If there are any auxiliary caches associated with this cache, save all
>   -     * objects to them.
>   +     *  If there are any auxiliary caches associated with this cache, save all
>   +     *  objects to them.
>         */
>        public void save()
>        {
>   @@ -326,47 +381,45 @@
>        }
>    
>        /**
>   -     * ResetAttributes allows for some of the attributes of a region to be
>   -     * reset in particular expiration time attriubtes, time to live, default
>   -     * time to live and idle time, and event handlers. Changing default
>   -     * settings on groups and regions will not affect existing objects. Only
>   -     * object loaded after the reset will use the new defaults. If no name
>   -     * argument is provided, the reset is applied to the region.
>   -     *
>   -     * NOTE: this method is currently not implemented.
>   -     *
>   -     * @param attr New attributes for this region.
>   -     * @exception CacheException
>   -     * @exception InvalidHandleException 
>   +     *  ResetAttributes allows for some of the attributes of a region to be
>   +     *  reset in particular expiration time attriubtes, time to live, default
>   +     *  time to live and idle time, and event handlers. Changing default
>   +     *  settings on groups and regions will not affect existing objects. Only
>   +     *  object loaded after the reset will use the new defaults. If no name
>   +     *  argument is provided, the reset is applied to the region. NOTE: this
>   +     *  method is currently not implemented.
>   +     *
>   +     *@param  attr                        New attributes for this region.
>   +     *@exception  CacheException
>   +     *@exception  InvalidHandleException
>         */
>        public void resetElementAttributes( Attributes attr )
>   -        throws CacheException, InvalidHandleException 
>   +        throws CacheException, InvalidHandleException
>        {
>            // Not implemented
>        }
>    
>        /**
>   -     * Reset attributes for a particular element in the cache.
>   +     *  Reset attributes for a particular element in the cache. NOTE: this
>   +     *  method is currently not implemented.
>         *
>   -     * NOTE: this method is currently not implemented.
>   -     *
>   -     * @param name Key of object to reset attributes for
>   -     * @param attr New attributes for the object
>   -     * @exception CacheException
>   -     * @exception InvalidHandleException
>   +     *@param  name                        Key of object to reset attributes for
>   +     *@param  attr                        New attributes for the object
>   +     *@exception  CacheException
>   +     *@exception  InvalidHandleException
>         */
>        public void resetElementAttributes( Object name, Attributes attr )
>   -        throws CacheException, InvalidHandleException 
>   -    { 
>   +        throws CacheException, InvalidHandleException
>   +    {
>            // Not implemented
>        }
>    
>        /**
>   -     * GetAttributes will return an attribute object describing the current
>   -     * attributes associated with the object name.
>   +     *  GetAttributes will return an attribute object describing the current
>   +     *  attributes associated with the object name.
>         *
>   -     * @return Attributes for this region
>   -     * @exception CacheException
>   +     *@return                     Attributes for this region
>   +     *@exception  CacheException
>         */
>        public Attributes getElementAttributes()
>            throws CacheException
>   @@ -375,19 +428,20 @@
>        }
>    
>        /**
>   -     * GetAttributes will return an attribute object describing the current
>   -     * attributes associated with the object name. The name object must 
>   -     * override the Object.equals and Object.hashCode methods.
>   -     *
>   -     * @param name Key of object to get attributes for 
>   -     * @return Attributes for the object, null if object not in cache
>   -     * @exception CacheException
>   +     *  GetAttributes will return an attribute object describing the current
>   +     *  attributes associated with the object name. The name object must
>   +     *  override the Object.equals and Object.hashCode methods.
>   +     *
>   +     *@param  name                Key of object to get attributes for
>   +     *@return                     Attributes for the object, null if object not
>   +     *      in cache
>   +     *@exception  CacheException
>         */
>        public Attributes getElementAttributes( Object name )
>            throws CacheException
>        {
>            Attributes attr = null;
>   -        
>   +
>            try
>            {
>                attr = cacheControl.getElementAttributes( ( Serializable ) name );
>   @@ -396,12 +450,12 @@
>            {
>                p( ioe.toString() );
>            }
>   -        
>   +
>            return attr;
>        }
>    
>        /**
>   -     * Dispose this region. Flushes objects to and closes auxiliary caches.
>   +     *  Dispose this region. Flushes objects to and closes auxiliary caches.
>         */
>        protected void dispose()
>        {
>   @@ -409,9 +463,9 @@
>        }
>    
>        /**
>   -     * Return statistics for the region.
>   +     *  Return statistics for the region.
>         *
>   -     * @return HTML formatted string containing region statistics
>   +     *@return    HTML formatted string containing region statistics
>         */
>        protected String getStats()
>        {
>   @@ -419,25 +473,45 @@
>        }
>    
>        /**
>   -     * Wrapper to System.out.println
>   +     *  Wrapper to System.out.println FIXME: Replace (at call points) with
>   +     *  logging mechanism.
>         *
>   -     * FIXME: Replace (at call points) with logging mechanism.
>   -     *
>   -     * @param s String to print
>   +     *@param  s  String to print
>         */
>        public static void p( String s )
>        {
>            System.out.println( s );
>        }
>   -    
>   +
>   +
>   +    /**
>   +     *  Gets the ICompositeCacheAttributes of the cache region
>   +     *
>   +     *@return
>   +     */
>   +    public ICompositeCacheAttributes getCacheAttributes()
>   +    {
>   +        return cacheControl.getCacheAttributes();
>   +    }
>   +
>   +    /**
>   +     *  Sets the ICompositeCacheAttributes of the cache region.
>   +     *
>   +     *@param  cattr  The new ICompositeCacheAttribute value
>   +     */
>   +    public void setCacheAttributes( ICompositeCacheAttributes cattr )
>   +    {
>   +        cacheControl.setCacheAttributes( cattr );
>   +    }
>   +
>        // -------------------------------- methods for testing and error reporting
>   -    
>   -    // protected void dumpMap() 
>   +
>   +    // protected void dumpMap()
>        // {
>        //     cache_control.dumpMap();
>        // }
>        //
>   -    // protected void dumpCacheEntries() 
>   +    // protected void dumpCacheEntries()
>        // {
>        //     cache_control.dumpCacheEntries();
>        // }
>   
>   
>   
>   1.6       +2 -2      jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java
>   
>   Index: LRUMemoryCache.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- LRUMemoryCache.java	13 Feb 2002 04:45:05 -0000	1.5
>   +++ LRUMemoryCache.java	14 Feb 2002 05:30:51 -0000	1.6
>   @@ -30,8 +30,8 @@
>    
>    /////////////////////////////////////////////////////
>    /**
>   - *  A fast reference management system. The least recently used items move tot
>   - *  he end of the list and get spooled to disk if the cache hub is configured to
>   + *  A fast reference management system. The least recently used items move to
>   + *  the end of the list and get spooled to disk if the cache hub is configured to
>     *  use a disk cache. Most of the cache bottelnecks ar ein IO. There are no io
>     *  bottlenecks here, it's all about processing power. Even though there are
>     *  only a few adjustments necessary to maintain the double linked list, we
>   
>   
>   
>   1.4       +43 -40    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/JCS.java
>   
>   Index: JCS.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/JCS.java,v
>   retrieving revision 1.3
>   retrieving revision 1.4
>   diff -u -r1.3 -r1.4
>   --- JCS.java	13 Feb 2002 03:01:05 -0000	1.3
>   +++ JCS.java	14 Feb 2002 05:30:51 -0000	1.4
>   @@ -11,28 +11,28 @@
>     * are met:
>     *
>     * 1. Redistributions of source code must retain the above copyright
>   - *    notice, this list of conditions and the following disclaimer.
>   + * notice, this list of conditions and the following disclaimer.
>     *
>     * 2. Redistributions in binary form must reproduce the above copyright
>   - *    notice, this list of conditions and the following disclaimer in
>   - *    the documentation and/or other materials provided with the
>   - *    distribution.
>   + * notice, this list of conditions and the following disclaimer in
>   + * the documentation and/or other materials provided with the
>   + * distribution.
>     *
>     * 3. The end-user documentation included with the redistribution, if
>   - *    any, must include the following acknowlegement:
>   - *       "This product includes software developed by the
>   - *        Apache Software Foundation (http://www.apache.org/)."
>   - *    Alternately, this acknowlegement may appear in the software itself,
>   - *    if and wherever such third-party acknowlegements normally appear.
>   + * any, must include the following acknowlegement:
>   + * "This product includes software developed by the
>   + * Apache Software Foundation (http://www.apache.org/)."
>   + * Alternately, this acknowlegement may appear in the software itself,
>   + * if and wherever such third-party acknowlegements normally appear.
>     *
>     * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
>   - *    Foundation" must not be used to endorse or promote products derived
>   - *    from this software without prior written permission. For written
>   - *    permission, please contact apache@apache.org.
>   + * Foundation" must not be used to endorse or promote products derived
>   + * from this software without prior written permission. For written
>   + * permission, please contact apache@apache.org.
>     *
>     * 5. Products derived from this software may not be called "Apache"
>   - *    nor may "Apache" appear in their names without prior written
>   - *    permission of the Apache Group.
>   + * nor may "Apache" appear in their names without prior written
>   + * permission of the Apache Group.
>     *
>     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>   @@ -66,23 +66,26 @@
>    import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
>    
>    /**
>   - * Simple class for using JCS. To use JCS in your application, you can use the
>   - * static methods of this class to get access objects (instances of this class)
>   - * for your cache regions. Ideally this class should be all you need to import
>   - * to use JCS.
>   - *
>   - * @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
>   - * @author <a href="mailto:jtaylor@apache.org">James Taylor</a>
>   - * @version $Id: JCS.java,v 1.3 2002/02/13 03:01:05 jtaylor Exp $
>   + *  Simple class for using JCS. To use JCS in your application, you can use the
>   + *  static methods of this class to get access objects (instances of this class)
>   + *  for your cache regions. Ideally this class should be all you need to import
>   + *  to use JCS. One JCS should be created for each region you want to access. If
>   + *  you have several regions, then get instances for each. For best performance
>   + *  the getInstance call should be made in an initialization method.
>   + *
>   + *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
>   + *@author     <a href="mailto:jtaylor@apache.org">James Taylor</a>
>   + *@created    February 13, 2002
>   + *@version    $Id: JCS.java,v 1.4 2002/02/14 05:30:51 asmuts Exp $
>     */
>    public class JCS extends GroupCacheAccess
>    {
>        private static GroupCacheManager cacheMgr;
>    
>        /**
>   -     * Protected constructor for use by the static factory methods. 
>   +     *  Protected constructor for use by the static factory methods.
>         *
>   -     * @param cacheControl Cache which the instance will provide access to
>   +     *@param  cacheControl  Cache which the instance will provide access to
>         */
>        protected JCS( Cache cacheControl )
>        {
>   @@ -90,29 +93,30 @@
>        }
>    
>        /**
>   -     * Get a JCS which accesses the provided region.
>   +     *  Get a JCS which accesses the provided region.
>         *
>   -     * @param region Region that return JCS will provide access to
>   -     * @return A JCS which provides access to a given region.
>   -     * @exception CacheException
>   +     *@param  region              Region that return JCS will provide access to
>   +     *@return                     A JCS which provides access to a given region.
>   +     *@exception  CacheException
>         */
>        public static JCS getInstance( String region )
>            throws CacheException
>        {
>            ensureCacheManager();
>   -        
>   +
>            return new JCS( ( Cache ) cacheMgr.getCache( region ) );
>   +
>        }
>    
>        /**
>   -     * Get a JCS which accesses the provided region.
>   +     *  Get a JCS which accesses the provided region.
>         *
>   -     * @param region Region that return JCS will provide access to
>   -     * @param icca Cache attributes for region
>   -     * @return A JCS which provides access to a given region.
>   -     * @exception CacheException
>   +     *@param  region              Region that return JCS will provide access to
>   +     *@param  icca                Cache attributes for region
>   +     *@return                     A JCS which provides access to a given region.
>   +     *@exception  CacheException
>         */
>   -    public static JCS getInstance( String region, 
>   +    public static JCS getInstance( String region,
>                                       ICompositeCacheAttributes icca )
>            throws CacheException
>        {
>   @@ -122,11 +126,10 @@
>        }
>    
>        /**
>   -     * Gets an instance of GroupCacheManager and stores it in the cacheMgr
>   -     * class field, if it is not already set. Unlike the implementation in
>   -     * CacheAccess, the cache manager is a GroupCacheManager. 
>   -     *
>   -     * NOTE: This can / will be moved up into GroupCacheAccess.
>   +     *  Gets an instance of GroupCacheManager and stores it in the cacheMgr
>   +     *  class field, if it is not already set. Unlike the implementation in
>   +     *  CacheAccess, the cache manager is a GroupCacheManager. NOTE: This can
>   +     *  will be moved up into GroupCacheAccess.
>         */
>        protected static void ensureCacheManager()
>        {
>   
>   
>   
>   1.6       +71 -26    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.java
>   
>   Index: ICacheAccess.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- ICacheAccess.java	15 Jan 2002 22:25:50 -0000	1.5
>   +++ ICacheAccess.java	14 Feb 2002 05:30:51 -0000	1.6
>   @@ -11,28 +11,28 @@
>     * are met:
>     *
>     * 1. Redistributions of source code must retain the above copyright
>   - *    notice, this list of conditions and the following disclaimer.
>   + * notice, this list of conditions and the following disclaimer.
>     *
>     * 2. Redistributions in binary form must reproduce the above copyright
>   - *    notice, this list of conditions and the following disclaimer in
>   - *    the documentation and/or other materials provided with the
>   - *    distribution.
>   + * notice, this list of conditions and the following disclaimer in
>   + * the documentation and/or other materials provided with the
>   + * distribution.
>     *
>     * 3. The end-user documentation included with the redistribution, if
>   - *    any, must include the following acknowlegement:
>   - *       "This product includes software developed by the
>   - *        Apache Software Foundation (http://www.apache.org/)."
>   - *    Alternately, this acknowlegement may appear in the software itself,
>   - *    if and wherever such third-party acknowlegements normally appear.
>   + * any, must include the following acknowlegement:
>   + * "This product includes software developed by the
>   + * Apache Software Foundation (http://www.apache.org/)."
>   + * Alternately, this acknowlegement may appear in the software itself,
>   + * if and wherever such third-party acknowlegements normally appear.
>     *
>     * 4. The names "The Jakarta Project", "Velocity", and "Apache Software
>   - *    Foundation" must not be used to endorse or promote products derived
>   - *    from this software without prior written permission. For written
>   - *    permission, please contact apache@apache.org.
>   + * Foundation" must not be used to endorse or promote products derived
>   + * from this software without prior written permission. For written
>   + * permission, please contact apache@apache.org.
>     *
>     * 5. Products derived from this software may not be called "Apache"
>   - *    nor may "Apache" appear in their names without prior written
>   - *    permission of the Apache Group.
>   + * nor may "Apache" appear in their names without prior written
>   + * permission of the Apache Group.
>     *
>     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
>     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>   @@ -57,7 +57,8 @@
>    import java.io.Serializable;
>    
>    import org.apache.stratum.jcs.access.exception.CacheException;
>   -
>   +import org.apache.stratum.jcs.access.exception.ObjectExistsException;
>   +import org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
>    import org.apache.stratum.jcs.engine.Attributes;
>    
>    /////////////////////////////////////////////////////////
>   @@ -92,6 +93,16 @@
>    
>    
>        /**
>   +     *  Puts in cache if an item does not exist with the name in that region.
>   +     *
>   +     *@param  name                Description of the Parameter
>   +     *@param  obj                 Description of the Parameter
>   +     *@exception  CacheException  Description of the Exception
>   +     */
>   +    void putSafe( Object name, Object obj )
>   +        throws CacheException;
>   +
>   +    /**
>         *  Puts and/or overides an element with the name in that region.
>         *
>         *@param  name                Description of the Parameter
>   @@ -118,36 +129,55 @@
>         *  Removes an item or all items. Should be called remove.
>         *
>         *@exception  CacheException  Description of the Exception
>   +     *@deprecated
>   +     *@see                        #remove
>         */
>        void destroy()
>            throws CacheException;
>    
>   -
>        /**
>         *  Description of the Method
>         *
>   -     *@param  name                Description of the Parameter
>         *@exception  CacheException  Description of the Exception
>         */
>   -    void destroy( Object name )
>   +    void remove()
>            throws CacheException;
>    
>   -
>        /**
>   -     *  Remove either the entire region of elements or the the specified element
>   -     *  from other caches specified in in the cache.properties file as lateral
>   -     *  caches.
>   +     *  Description of the Method
>   +     *
>   +     *@param  name                Description of the Parameter
>   +     *@exception  CacheException  Description of the Exception
>   +     *@deprecated
>   +     *@see                        #remove
>         */
>   -    void removeLateralDirect();
>   -
>   +    void destroy( Object name )
>   +        throws CacheException;
>    
>        /**
>         *  Description of the Method
>         *
>   -     *@param  key  Description of the Parameter
>   +     *@param  name                Description of the Parameter
>   +     *@exception  CacheException  Description of the Exception
>         */
>   -    void removeLateralDirect( Serializable key );
>   +    void remove( Object name )
>   +        throws CacheException;
>    
>   +//    /**
>   +//     *  Remove either the entire region of elements or the the specified element
>   +//     *  from other caches specified in in the cache.properties file as lateral
>   +//     *  caches.
>   +//     */
>   +//    void removeLateralDirect();
>   +//
>   +//
>   +//    /**
>   +//     *  Description of the Method
>   +//     *
>   +//     *@param  key  Description of the Parameter
>   +//     */
>   +//    void removeLateralDirect( Serializable key );
>   +//
>    
>        /**
>         *  ResetAttributes allows for some of the attributes of a region to be
>   @@ -199,6 +229,21 @@
>         */
>        Attributes getElementAttributes( Object name )
>            throws CacheException;
>   +
>   +
>   +    /**
>   +     *  Gets the ICompositeCacheAttributes of the cache region
>   +     *
>   +     *@return
>   +     */
>   +    public ICompositeCacheAttributes getCacheAttributes();
>   +
>   +    /**
>   +     *  Sets the ICompositeCacheAttributes of the cache region
>   +     *
>   +     *@param  cattr  The new ICompositeCacheAttribute value
>   +     */
>   +    public void setCacheAttributes( ICompositeCacheAttributes cattr );
>    
>    }
>    // end interface
>   
>   
>   
>   1.13      +80 -29    jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java
>   
>   Index: Cache.java
>   ===================================================================
>   RCS file: /home/cvs/jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java,v
>   retrieving revision 1.12
>   retrieving revision 1.13
>   diff -u -r1.12 -r1.13
>   --- Cache.java	13 Feb 2002 19:13:59 -0000	1.12
>   +++ Cache.java	14 Feb 2002 05:30:51 -0000	1.13
>   @@ -62,6 +62,7 @@
>    
>    import org.apache.stratum.jcs.access.exception.CacheException;
>    import org.apache.stratum.jcs.access.exception.ObjectNotFoundException;
>   +import org.apache.stratum.jcs.access.exception.ObjectExistsException;
>    
>    import org.apache.stratum.jcs.engine.Attributes;
>    import org.apache.stratum.jcs.engine.CacheElement;
>   @@ -88,13 +89,13 @@
>     *@author     asmuts
>     *@created    January 15, 2002
>     */
>   -public class Cache 
>   -    implements ICacheHub, ICache, ICompositeCache, Serializable
>   +public class Cache
>   +     implements ICacheHub, ICache, ICompositeCache, Serializable
>    {
>   -    private static final Log log = LogSource.getInstance( Cache.class );
>   -    
>   +    private final static Log log = LogSource.getInstance( Cache.class );
>   +
>        /**
>   -     *  Description of the Field
>   +     *  not used for much
>         */
>        public final String className;
>    
>   @@ -105,15 +106,16 @@
>    
>        private boolean alive = true;
>    
>   +    // this is int he cacheAttr, shouldn't be used, remove
>        final String cacheName;
>    
>        /**
>   -     *  Region Elemental Attributes
>   +     *  Region Elemental Attributes, default
>         */
>        public Attributes attr;
>    
>        /**
>   -     *  Cache Attributes
>   +     *  Cache Attributes, for hub and memory auxiliary
>         */
>        public ICompositeCacheAttributes cacheAttr;
>    
>   @@ -124,6 +126,11 @@
>        private int ramHit;
>        private int miss;
>    
>   +    /**
>   +     *  The cache hub can only have one memory cache. This could be made more
>   +     *  flexible in the future, but they are tied closely together. More than
>   +     *  one doesn't make much sense.
>   +     */
>        // IMemoryCache
>        IMemoryCache memCache;
>    
>   @@ -173,9 +180,9 @@
>    
>            if ( log.isDebugEnabled() )
>            {
>   -            log.debug( "Constructed cache with name " + cacheName + 
>   -                       " and cache attributes: " + cattr );
>   -        } 
>   +            log.debug( "Constructed cache with name " + cacheName +
>   +                " and cache attributes: " + cattr );
>   +        }
>            else if ( log.isInfoEnabled() )
>            {
>                log.info( "Constructed cache with name: " + cacheName );
>   @@ -186,7 +193,9 @@
>        /**
>         *  Description of the Method
>         *
>   -     *@param  ce  Description of the Parameter
>   +     *@param  ce     Description of the Parameter
>   +     *@deprecated
>   +     *@see           this will become protected
>         */
>        public void add( ICacheElement ce )
>        {
>   @@ -203,7 +212,29 @@
>    
>    
>        /**
>   -     *  OSC4j interface put methods, and make it the first in the link list.
>   +     *  Will no override existing items.
>   +     *
>   +     *@param  key              Description of the Parameter
>   +     *@param  val              Description of the Parameter
>   +     *@exception  IOException  Description of the Exception
>   +     */
>   +    public void putSafe( Serializable key, Serializable val )
>   +        throws IOException, ObjectExistsException
>   +    {
>   +        if ( this.get( key ) != null )
>   +        {
>   +            throw new ObjectExistsException( "Object exists for key " + key );
>   +        }
>   +        else
>   +        {
>   +            put( key, val, ( Attributes ) this.attr.copy() );
>   +        }
>   +        return;
>   +    }
>   +
>   +
>   +    /**
>   +     *  Put in cache and configured auxiliaries.
>         *
>         *@param  key              Description of the Parameter
>         *@param  val              Description of the Parameter
>   @@ -234,18 +265,18 @@
>            //if ( this.get( key ) != null ) {
>            //  throw new ObjectExistsException( "Object exists for key " + key );
>            //}
>   -        
>   +
>            if ( key == null || val == null )
>            {
>   -            NullPointerException npe = 
>   -                new NullPointerException( "key=" + key + " and val=" + val + 
>   -                                          " must not be null." );
>   -            
>   +            NullPointerException npe =
>   +                new NullPointerException( "key=" + key + " and val=" + val +
>   +                " must not be null." );
>   +
>                log.error( "Key or value was null. Exception will be thrown", npe );
>   -            
>   +
>                throw npe;
>            }
>   -        
>   +
>            try
>            {
>                updateCaches( key, val, attr );
>   @@ -271,7 +302,7 @@
>            throws IOException
>        {
>            // FIXME: Replace with tracing aspects
>   -        
>   +
>            if ( log.isDebugEnabled() )
>            {
>                log.debug( "updateCaches(key,val,attr) > ICache.INCLUDE_REMOTE_CACHE= " + ICache.INCLUDE_REMOTE_CACHE + " key = " + key );
>   @@ -296,7 +327,7 @@
>            throws IOException
>        {
>            // FIXME: Replace with tracing aspects
>   -        
>   +
>            if ( log.isDebugEnabled() )
>            {
>                log.debug( "updateCaches(key,val,attr,updateRemoteCache) > updateRemoteCache= " + updateRemoteCache + " key = " + key );
>   @@ -319,7 +350,7 @@
>            throws IOException
>        {
>            // FIXME: Replace with tracing aspects
>   -        
>   +
>            if ( log.isDebugEnabled() )
>            {
>                log.debug( "update(ce) > ICache.INCLUDE_REMOTE_CACHE= " + ICache.INCLUDE_REMOTE_CACHE + " key = " + ce.getKey() );
>   @@ -359,11 +390,11 @@
>                throw new IllegalArgumentException(
>                    "key must not end with " + NAME_COMPONENT_DELIMITER + " for a put operation" );
>            }
>   -        
>   +
>            // FIXME: Replace with tracing aspects
>    
>            if ( log.isDebugEnabled() )
>   -        {                        
>   +        {
>                log.debug( "Cache.updateExclude(ce,updateRemoteCache) > updateRemoteCache = " + updateRemoteCache + " key=" + ce.getKey() + ", value type=" + ce.getVal().getClass().getName() + ", " + ce.getAttributes().toString() );
>    
>                if ( updateRemoteCache == ICache.INCLUDE_REMOTE_CACHE )
>   @@ -392,7 +423,7 @@
>            for ( int i = 0; i < auxCaches.length; i++ )
>            {
>                ICache aux = auxCaches[i];
>   -            
>   +
>                if ( log.isDebugEnabled() )
>                {
>                    log.debug( "aux.getCacheType() = " + aux.getCacheType() );
>   @@ -433,8 +464,8 @@
>                    // restrictions
>                    if ( log.isDebugEnabled() )
>                    {
>   -                    log.debug( "lateralcache in aux list: cattr " + 
>   -                               cacheAttr.getUseLateral() );
>   +                    log.debug( "lateralcache in aux list: cattr " +
>   +                        cacheAttr.getUseLateral() );
>                    }
>                    if ( cacheAttr.getUseLateral() && ce.getAttributes().IS_LATERAL && updateRemoteCache )
>                    {
>   @@ -682,7 +713,7 @@
>                    if ( log.isInfoEnabled() )
>                    {
>                        log.info( ce.getKey() + " expired" );
>   -                }               
>   +                }
>    
>                    this.remove( key );
>                    //throw new ObjectNotFoundException( key + " expired from cache" );
>   @@ -1078,7 +1109,7 @@
>    
>        ////////////////////////////////////////////////
>        /**
>   -     *  Gets the attributes attribute of the Cache object
>   +     *  Gets the default element attribute of the Cache object
>         *
>         *@return    The attributes value
>         */
>   @@ -1087,6 +1118,26 @@
>            return attr;
>        }
>    
>   +
>   +    /**
>   +     *  Gets the ICompositeCacheAttributes attribute of the Cache object
>   +     *
>   +     *@return    The ICompositeCacheAttributes value
>   +     */
>   +    public ICompositeCacheAttributes getCacheAttributes()
>   +    {
>   +        return this.cacheAttr;
>   +    }
>   +
>   +    /**
>   +     *  Sets the ICompositeCacheAttributes attribute of the Cache object
>   +     *
>   +     *@param  cattr  The new ICompositeCacheAttributes value
>   +     */
>   +    public void setCacheAttributes( ICompositeCacheAttributes cattr )
>   +    {
>   +        this.cacheAttr = cattr;
>   +    }
>    
>        ////////////////////////////////////////////////
>        /**
>   
>   
>   
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: cvs commit:jakarta-turbine-stratum/src/java/org/apache/stratum/jcs/engine/controlCache.java

Posted by Aaron Smuts <aa...@verizon.net>.
I run it on each class I work on individually.  I can't write in the
turbine style.  I just can't do it.  I'll need new settings I guess.  I
noticed that it collapses all the comments into giant paragraphs.  

> -----Original Message-----
> From: James Taylor [mailto:jtaylor@4lane.com]
> Sent: Thursday, February 14, 2002 7:41 AM
> To: Turbine Developers List
> Subject: Re: cvs commit:jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/engine/controlCache.java
> 
> Aaron,
> 
> Minor thing, but it looks like JRefactory is screwing up the
formatting
> of the license and javadoc. Now that it has been run once on all the
> files, you should probably not run it on them again. I'll try and fix
> formatting errors that creep in =] Probably this is a problem with the
> JRefactory settings I gave you, I'm not an expert on that tool.
> 
> Thanks,
> James
> 
> On Thu, 2002-02-14 at 00:30, asmuts@apache.org wrote:
> > asmuts      02/02/13 21:30:51
> >
> >   Modified:    src/java/org/apache/stratum/jcs/access
> TestCacheAccess.java
> >                         GroupCacheAccess.java CacheAccess.java
> >                src/java/org/apache/stratum/jcs/engine/memory/lru
> >                         LRUMemoryCache.java
> >                src/java/org/apache/stratum/jcs JCS.java
> >                src/java/org/apache/stratum/jcs/access/behavior
> >                         ICacheAccess.java
> >                src/java/org/apache/stratum/jcs/engine/control
Cache.java
> >   Log:
> >   removed old lateral direct methods, deprecated destroy for remove
> >   created access methods to update the cache attributes for
controlling
> memory size.
> >   want to move into auxiliary configuration.  Should give a list and
let
> them be selected or something to reduce configuration.
> >
> >   Revision  Changes    Path
> >   1.9       +37 -37    jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java
> >
> >   Index: TestCacheAccess.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/TestCacheAccess.java,v
> >   retrieving revision 1.8
> >   retrieving revision 1.9
> >   diff -u -r1.8 -r1.9
> >   --- TestCacheAccess.java	19 Jan 2002 06:27:12 -0000	1.8
> >   +++ TestCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.9
> >   @@ -158,11 +158,11 @@
> >                        {
> >                            help();
> >                        }
> >   -                    else
> >   -                        if ( message.startsWith(
> "removeLateralDirect" ) )
> >   -                    {
> >   -                        removeLateralDirect( message );
> >   -                    }
> >   +//                    else
> >   +//                        if ( message.startsWith(
> "removeLateralDirect" ) )
> >   +//                    {
> >   +//                        removeLateralDirect( message );
> >   +//                    }
> >                        else
> >                            if ( message.startsWith(
"getAttributeNames"
> ) )
> >                        {
> >   @@ -577,7 +577,7 @@
> >                            if ( message.startsWith( "remove" ) )
> >                        {
> >                            String key = message.substring(
> message.indexOf( " " ) + 1, message.length() );
> >   -                        cache_control.destroy( key );
> >   +                        cache_control.remove( key );
> >                            p( "removed " + key );
> >                        }
> >                        else
> >   @@ -680,43 +680,43 @@
> >            p( "type 'put key val' to put" );
> >            p( "type 'stats' to get stats" );
> >            p( "type 'cloneattr num' to clone attr" );
> >   -        p( "type 'removeLateralDirect key' to remove lateral" );
> >   +//        p( "type 'removeLateralDirect key' to remove lateral"
);
> >            p( "type 'switch number' to switch to testCache[number],
1 ==
> testCache1" );
> >            p( "type 'help' for commands" );
> >
> >        }
> >
> >
> >   -    ////////////////////////////////////////
> >   -    /**
> >   -     *  Description of the Method
> >   -     *
> >   -     *@param  message  Description of the Parameter
> >   -     */
> >   -    public static void removeLateralDirect( String message )
> >   -    {
> >   -
> >   -        String key = null;
> >   -        StringTokenizer toke = new StringTokenizer( message );
> >   -        int tcnt = 0;
> >   -        while ( toke.hasMoreElements() )
> >   -        {
> >   -            tcnt++;
> >   -            String t = ( String ) toke.nextElement();
> >   -            if ( tcnt == 2 )
> >   -            {
> >   -                key = t.trim();
> >   -            }
> >   -        }
> >   -
> >   -        if ( tcnt < 2 )
> >   -        {
> >   -            key = "ALL";
> >   -        }
> >   -
> >   -        cache_control.removeLateralDirect( key );
> >   -        p( "called delete multicast for key " + key );
> >   -    }
> >   +//    ////////////////////////////////////////
> >   +//    /**
> >   +//     *  Description of the Method
> >   +//     *
> >   +//     *@param  message  Description of the Parameter
> >   +//     */
> >   +//    public static void removeLateralDirect( String message )
> >   +//    {
> >   +//
> >   +//        String key = null;
> >   +//        StringTokenizer toke = new StringTokenizer( message );
> >   +//        int tcnt = 0;
> >   +//        while ( toke.hasMoreElements() )
> >   +//        {
> >   +//            tcnt++;
> >   +//            String t = ( String ) toke.nextElement();
> >   +//            if ( tcnt == 2 )
> >   +//            {
> >   +//                key = t.trim();
> >   +//            }
> >   +//        }
> >   +//
> >   +//        if ( tcnt < 2 )
> >   +//        {
> >   +//            key = "ALL";
> >   +//        }
> >   +//
> >   +//        cache_control.removeLateralDirect( key );
> >   +//        p( "called delete multicast for key " + key );
> >   +//    }
> >
> >        // end help
> >
> >
> >
> >
> >   1.10      +6 -0      jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java
> >
> >   Index: GroupCacheAccess.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/GroupCacheAccess.java,v
> >   retrieving revision 1.9
> >   retrieving revision 1.10
> >   diff -u -r1.9 -r1.10
> >   --- GroupCacheAccess.java	12 Feb 2002 15:47:55 -0000	1.9
> >   +++ GroupCacheAccess.java	14 Feb 2002 05:30:50 -0000	1.10
> >   @@ -477,12 +477,18 @@
> >         *
> >         *@param  name   Description of the Parameter
> >         *@param  group  Description of the Parameter
> >   +     *
> >   +     * @deprecated
> >         */
> >        public void destroy( String name, String group )
> >        {
> >            removeAttribute( name, group );
> >        }
> >
> >   +    public void remove( String name, String group )
> >   +    {
> >   +        removeAttribute( name, group );
> >   +    }
> >
> >        /////////////////////////////////////
> >        /**
> >
> >
> >
> >   1.7       +229 -155  jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java
> >
> >   Index: CacheAccess.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/access/CacheAccess.java,v
> >   retrieving revision 1.6
> >   retrieving revision 1.7
> >   diff -u -r1.6 -r1.7
> >   --- CacheAccess.java	12 Feb 2002 03:16:48 -0000	1.6
> >   +++ CacheAccess.java	14 Feb 2002 05:30:50 -0000	1.7
> >   @@ -11,28 +11,28 @@
> >     * are met:
> >     *
> >     * 1. Redistributions of source code must retain the above
copyright
> >   - *    notice, this list of conditions and the following
disclaimer.
> >   + * notice, this list of conditions and the following disclaimer.
> >     *
> >     * 2. Redistributions in binary form must reproduce the above
> copyright
> >   - *    notice, this list of conditions and the following
disclaimer in
> >   - *    the documentation and/or other materials provided with the
> >   - *    distribution.
> >   + * notice, this list of conditions and the following disclaimer
in
> >   + * the documentation and/or other materials provided with the
> >   + * distribution.
> >     *
> >     * 3. The end-user documentation included with the
redistribution, if
> >   - *    any, must include the following acknowlegement:
> >   - *       "This product includes software developed by the
> >   - *        Apache Software Foundation (http://www.apache.org/)."
> >   - *    Alternately, this acknowlegement may appear in the software
> itself,
> >   - *    if and wherever such third-party acknowlegements normally
> appear.
> >   + * any, must include the following acknowlegement:
> >   + * "This product includes software developed by the
> >   + * Apache Software Foundation (http://www.apache.org/)."
> >   + * Alternately, this acknowlegement may appear in the software
> itself,
> >   + * if and wherever such third-party acknowlegements normally
appear.
> >     *
> >     * 4. The names "The Jakarta Project", "Velocity", and "Apache
> Software
> >   - *    Foundation" must not be used to endorse or promote products
> derived
> >   - *    from this software without prior written permission. For
> written
> >   - *    permission, please contact apache@apache.org.
> >   + * Foundation" must not be used to endorse or promote products
> derived
> >   + * from this software without prior written permission. For
written
> >   + * permission, please contact apache@apache.org.
> >     *
> >     * 5. Products derived from this software may not be called
"Apache"
> >   - *    nor may "Apache" appear in their names without prior
written
> >   - *    permission of the Apache Group.
> >   + * nor may "Apache" appear in their names without prior written
> >   + * permission of the Apache Group.
> >     *
> >     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR
IMPLIED
> >     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES
> >   @@ -73,25 +73,31 @@
> >    import
org.apache.stratum.jcs.engine.control.CompositeCacheManager;
> >
> >    /**
> >   - * Class which provides interface for all access to the cache. An
> instance of
> >   - * this class is tied to a specific cache region. Static methods
are
> provided
> >   - * to get such instances.
> >   + *  Class which provides interface for all access to the cache.
An
> instance of
> >   + *  this class is tied to a specific cache region. Static methods
are
> provided
> >   + *  to get such instances.
> >     *
> >   - * @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
> >   - * @version $Id: CacheAccess.java,v 1.6 2002/02/12 03:16:48
jtaylor
> Exp $
> >   + *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
> >   + *@created    February 13, 2002
> >   + *@version    $Id: CacheAccess.java,v 1.7 2002/02/14 05:30:50
asmuts
> Exp $
> >     */
> >    public class CacheAccess implements ICacheAccess
> >    {
> >   -    /** Cache manager use by the various forms of defineRegion
and
> getAccess */
> >   +    /**
> >   +     *  Cache manager use by the various forms of defineRegion
and
> getAccess
> >   +     */
> >        private static CompositeCacheManager cacheMgr;
> >
> >   -    /** Cache that a given instance of this class provides access
to
> */
> >   +    /**
> >   +     *  Cache that a given instance of this class provides access
to.
> Should
> >   +     *  this be the inteface?
> >   +     */
> >        protected Cache cacheControl;
> >
> >        /**
> >   -     * Constructor for the CacheAccess object.
> >   +     *  Constructor for the CacheAccess object.
> >         *
> >   -     * @param cacheControl The cache which the created instance
> accesses
> >   +     *@param  cacheControl  The cache which the created instance
> accesses
> >         */
> >        protected CacheAccess( Cache cacheControl )
> >        {
> >   @@ -101,89 +107,89 @@
> >        // ----------------------------- static methods for access to
> cache regions
> >
> >        /**
> >   -     * Define a new cache region with the given name.
> >   -     *
> >   -     * In the oracle specification, these attributes are global
and
> not region
> >   -     * specific, regional overirdes is a value add each region
should
> be able
> >   -     * to house both cache and element attribute sets. It is more
> efficient to
> >   -     * define a cache in the props file and then strictly use the
get
> access
> >   -     * method. Use of the define region outside of an
initialization
> block
> >   -     * should be avoided.
> >   -     *
> >   -     * @param name Name that will identify the region
> >   -     * @return CacheAccess instance for the new region
> >   -     * @exception CacheException
> >   +     *  Define a new cache region with the given name. In the
oracle
> >   +     *  specification, these attributes are global and not region
> specific,
> >   +     *  regional overirdes is a value add each region should be
able
> to house
> >   +     *  both cache and element attribute sets. It is more
efficient
> to define a
> >   +     *  cache in the props file and then strictly use the get
access
> method. Use
> >   +     *  of the define region outside of an initialization block
> should be
> >   +     *  avoided.
> >   +     *
> >   +     *@param  name                Name that will identify the
region
> >   +     *@return                     CacheAccess instance for the
new
> region
> >   +     *@exception  CacheException
> >         */
> >        public static CacheAccess defineRegion( String name )
> >            throws CacheException
> >        {
> >            ensureCacheManager();
> >   -
> >   +
> >            return new CacheAccess( ( Cache ) cacheMgr.getCache( name
)
> );
> >        }
> >
> >        /**
> >   -     * Define a new cache region with the specified name and
> attributes.
> >   +     *  Define a new cache region with the specified name and
> attributes.
> >         *
> >   -     * @param name Name that will identify the region
> >   -     * @param cattr CompositeCacheAttributes for the region
> >   -     * @return CacheAccess instance for the new region
> >   -     * @exception CacheException
> >   +     *@param  name                Name that will identify the
region
> >   +     *@param  cattr               CompositeCacheAttributes for
the
> region
> >   +     *@return                     CacheAccess instance for the
new
> region
> >   +     *@exception  CacheException
> >         */
> >   -    public static CacheAccess defineRegion( String name,
> >   +    public static CacheAccess defineRegion( String name,
> >
CompositeCacheAttributes
> cattr )
> >            throws CacheException
> >        {
> >            ensureCacheManager();
> >   -
> >   +
> >            return new CacheAccess( ( Cache ) cacheMgr.getCache(
name,
> cattr ) );
> >        }
> >
> >        /**
> >   -     * Define a new cache region with the specified name and
> attributes.
> >   +     *  Define a new cache region with the specified name and
> attributes and
> >   +     *  return a CacheAccess to it.
> >         *
> >   -     * @param name Name that will identify the region
> >   -     * @param cattr CompositeCacheAttributes for the region
> >   -     * @param attr Attributes for the region
> >   -     * @return CacheAccess instance for the new region
> >   -     * @exception CacheException
> >   +     *@param  name                Name that will identify the
region
> >   +     *@param  cattr               CompositeCacheAttributes for
the
> region
> >   +     *@param  attr                Attributes for the region
> >   +     *@return                     CacheAccess instance for the
new
> region
> >   +     *@exception  CacheException
> >         */
> >   -    public static CacheAccess defineRegion( String name,
> >   -
CompositeCacheAttributes
> cattr,
> >   +    public static CacheAccess defineRegion( String name,
> >   +
CompositeCacheAttributes
> cattr,
> >                                                Attributes attr )
> >            throws CacheException
> >        {
> >            ensureCacheManager();
> >   -
> >   -        return new CacheAccess(
> >   +
> >   +        return new CacheAccess(
> >                ( Cache ) cacheMgr.getCache( name, cattr, attr ) );
> >        }
> >
> >        /**
> >   -     * Get a CacheAccess instance for the given region.
> >   +     *  Get a CacheAccess instance for the given region.
> >         *
> >   -     * @param region Name that identifies the region
> >   -     * @return CacheAccess instance for region
> >   -     * @exception CacheException
> >   +     *@param  region              Name that identifies the region
> >   +     *@return                     CacheAccess instance for region
> >   +     *@exception  CacheException
> >         */
> >        public static CacheAccess getAccess( String region )
> >            throws CacheException
> >        {
> >            ensureCacheManager();
> >   -
> >   +
> >            return new CacheAccess( ( Cache ) cacheMgr.getCache(
region )
> );
> >        }
> >
> >        /**
> >   -     * Get a CacheAccess instance for the given region with the
given
> >   -     * attributes.
> >   +     *  Get a CacheAccess instance for the given region with the
> given
> >   +     *  attributes.
> >         *
> >   -     * @param region Name that identifies the region
> >   -     * @param icca
> >   -     * @return CacheAccess instance for region
> >   -     * @exception CacheException
> >   +     *@param  region              Name that identifies the region
> >   +     *@param  icca
> >   +     *@return                     CacheAccess instance for region
> >   +     *@exception  CacheException
> >         */
> >   -    public static CacheAccess getAccess( String region,
> >   +    public static CacheAccess getAccess( String region,
> >
ICompositeCacheAttributes
> icca )
> >            throws CacheException
> >        {
> >   @@ -193,8 +199,8 @@
> >        }
> >
> >        /**
> >   -     * Helper method which checks to make sure the cacheMgr class
> field is set,
> >   -     * and if not requests an instance from CacheManagerFactory.
> >   +     *  Helper method which checks to make sure the cacheMgr
class
> field is set,
> >   +     *  and if not requests an instance from CacheManagerFactory.
> >         */
> >        protected static void ensureCacheManager()
> >        {
> >   @@ -209,15 +215,15 @@
> >                }
> >            }
> >        }
> >   -
> >   +
> >        // -------------------------------------------------------
> instance methods
> >
> >        /**
> >   -     * Retrieve an object from the cache region this instance
> provides access
> >   -     * to.
> >   +     *  Retrieve an object from the cache region this instance
> provides access
> >   +     *  to.
> >         *
> >   -     * @param name Key the object is stored as
> >   -     * @return The object if found or null
> >   +     *@param  name  Key the object is stored as
> >   +     *@return       The object if found or null
> >         */
> >        public Object get( String name )
> >        {
> >   @@ -225,14 +231,38 @@
> >        }
> >
> >        /**
> >   -     * Place a new object in the cache, associated with key name.
If
> there is
> >   -     * currently an object associated with name in the region it
is
> replaced.
> >   -     * Names are scoped to a region so they must be unique within
the
> >   -     * region they are placed.
> >   -     *
> >   -     * @param name Key object will be stored with
> >   -     * @param obj Object to store
> >   -     * @exception CacheException
> >   +     *  Place a new object in the cache, associated with key
name. If
> there is
> >   +     *  currently an object associated with name in the region an
> >   +     *  ObjectExistsException is thrown. Names are scoped to a
region
> so they
> >   +     *  must be unique within the region they are placed.
> >   +     *
> >   +     *@param  name                Key object will be stored with
> >   +     *@param  obj                 Object to store
> >   +     *@exception  CacheException
> >   +     */
> >   +    public void putSafe( Object name, Object obj )
> >   +        throws CacheException
> >   +    {
> >   +        try
> >   +        {
> >   +            cacheControl.putSafe( ( Serializable ) name, (
> Serializable ) obj );
> >   +        }
> >   +        catch ( Exception e )
> >   +        {
> >   +            throw new CacheException( e );
> >   +        }
> >   +    }
> >   +
> >   +
> >   +    /**
> >   +     *  Place a new object in the cache, associated with key
name. If
> there is
> >   +     *  currently an object associated with name in the region it
is
> replaced.
> >   +     *  Names are scoped to a region so they must be unique
within
> the region
> >   +     *  they are placed.
> >   +     *
> >   +     *@param  name                Key object will be stored with
> >   +     *@param  obj                 Object to store
> >   +     *@exception  CacheException
> >         */
> >        public void put( Object name, Object obj )
> >            throws CacheException
> >   @@ -248,22 +278,22 @@
> >        }
> >
> >        /**
> >   -     * Place a new object in the cache. This form allows
attributes
> to
> >   -     * associate with the object may be specified with attr.
> >   +     *  Place a new object in the cache. This form allows
attributes
> to
> >   +     *  associate with the object may be specified with attr.
> >         *
> >   -     * @param name Key object will be stored with
> >   -     * @param obj Object to store
> >   -     * @param attr Attributes to store object with
> >   -     * @exception CacheException
> >   +     *@param  name                Key object will be stored with
> >   +     *@param  obj                 Object to store
> >   +     *@param  attr                Attributes to store object with
> >   +     *@exception  CacheException
> >         */
> >        public void put( Object name, Object obj, Attributes attr )
> >            throws CacheException
> >        {
> >            try
> >            {
> >   -            cacheControl.put( ( Serializable ) name,
> >   -                              ( Serializable ) obj,
> >   -                              attr );
> >   +            cacheControl.put( ( Serializable ) name,
> >   +                ( Serializable ) obj,
> >   +                attr );
> >            }
> >            catch ( Exception e )
> >            {
> >   @@ -272,10 +302,10 @@
> >        }
> >
> >        /**
> >   -     * Destory the region and all objects within it. After
calling
> this method,
> >   -     * the Cache object can no longer be used as it will be
closed.
> >   +     *  Destory the region and all objects within it. After
calling
> this method,
> >   +     *  the Cache object can no longer be used as it will be
closed.
> >         *
> >   -     * @exception  CacheException
> >   +     *@exception  CacheException
> >         */
> >        public void destroy()
> >            throws CacheException
> >   @@ -284,41 +314,66 @@
> >        }
> >
> >        /**
> >   -     * Invalidate all objects associated with key name, removing
all
> references
> >   -     * to the objects from the cache.
> >   +     *  Description of the Method
> >         *
> >   -     * @param name Key that specifies object to invalidate
> >   -     * @exception CacheException
> >   +     *@exception  CacheException  Description of the Exception
> >         */
> >   -    public void destroy( Object name )
> >   +    public void remove()
> >            throws CacheException
> >        {
> >   -        cacheControl.remove( ( Serializable ) name );
> >   +        cacheControl.removeAll();
> >        }
> >
> >        /**
> >   -     * Remove the entire region of elements from other caches
> specified in the
> >   -     * cache.properties file as lateral caches.
> >   +     *  Invalidate all objects associated with key name, removing
all
> references
> >   +     *  to the objects from the cache.
> >   +     *
> >   +     *@param  name                Key that specifies object to
> invalidate
> >   +     *@exception  CacheException
> >         */
> >   -    public void removeLateralDirect()
> >   +    public void destroy( Object name )
> >   +        throws CacheException
> >        {
> >   -        cacheControl.removeLateralDirect( "ALL" );
> >   +        cacheControl.remove( ( Serializable ) name );
> >        }
> >
> >        /**
> >   -     * Remove the specified element from other caches specified
in in
> the
> >   -     * cache.properties file as lateral caches.
> >   +     *  Description of the Method
> >         *
> >   -     * @param key Key identifying object to remove
> >   +     *@param  name                Description of the Parameter
> >   +     *@exception  CacheException  Description of the Exception
> >         */
> >   -    public void removeLateralDirect( Serializable key )
> >   +    public void remove( Object name )
> >   +        throws CacheException
> >        {
> >   -        cacheControl.removeLateralDirect( key );
> >   +        cacheControl.remove( ( Serializable ) name );
> >        }
> >
> >   +
> >   +    // TODO: rethink the point of these methods
> >   +//    /**
> >   +//     * Remove the entire region of elements from other caches
> specified in the
> >   +//     * cache.properties file as lateral caches.
> >   +//     */
> >   +//    public void removeLateralDirect()
> >   +//    {
> >   +//        cacheControl.removeLateralDirect( "ALL" );
> >   +//    }
> >   +//
> >   +//    /**
> >   +//     * Remove the specified element from other caches specified
in
> in the
> >   +//     * cache.properties file as lateral caches.
> >   +//     *
> >   +//     * @param key Key identifying object to remove
> >   +//     */
> >   +//    public void removeLateralDirect( Serializable key )
> >   +//    {
> >   +//        cacheControl.removeLateralDirect( key );
> >   +//    }
> >   +
> >        /**
> >   -     * If there are any auxiliary caches associated with this
cache,
> save all
> >   -     * objects to them.
> >   +     *  If there are any auxiliary caches associated with this
cache,
> save all
> >   +     *  objects to them.
> >         */
> >        public void save()
> >        {
> >   @@ -326,47 +381,45 @@
> >        }
> >
> >        /**
> >   -     * ResetAttributes allows for some of the attributes of a
region
> to be
> >   -     * reset in particular expiration time attriubtes, time to
live,
> default
> >   -     * time to live and idle time, and event handlers. Changing
> default
> >   -     * settings on groups and regions will not affect existing
> objects. Only
> >   -     * object loaded after the reset will use the new defaults.
If no
> name
> >   -     * argument is provided, the reset is applied to the region.
> >   -     *
> >   -     * NOTE: this method is currently not implemented.
> >   -     *
> >   -     * @param attr New attributes for this region.
> >   -     * @exception CacheException
> >   -     * @exception InvalidHandleException
> >   +     *  ResetAttributes allows for some of the attributes of a
region
> to be
> >   +     *  reset in particular expiration time attriubtes, time to
live,
> default
> >   +     *  time to live and idle time, and event handlers. Changing
> default
> >   +     *  settings on groups and regions will not affect existing
> objects. Only
> >   +     *  object loaded after the reset will use the new defaults.
If
> no name
> >   +     *  argument is provided, the reset is applied to the region.
> NOTE: this
> >   +     *  method is currently not implemented.
> >   +     *
> >   +     *@param  attr                        New attributes for this
> region.
> >   +     *@exception  CacheException
> >   +     *@exception  InvalidHandleException
> >         */
> >        public void resetElementAttributes( Attributes attr )
> >   -        throws CacheException, InvalidHandleException
> >   +        throws CacheException, InvalidHandleException
> >        {
> >            // Not implemented
> >        }
> >
> >        /**
> >   -     * Reset attributes for a particular element in the cache.
> >   +     *  Reset attributes for a particular element in the cache.
NOTE:
> this
> >   +     *  method is currently not implemented.
> >         *
> >   -     * NOTE: this method is currently not implemented.
> >   -     *
> >   -     * @param name Key of object to reset attributes for
> >   -     * @param attr New attributes for the object
> >   -     * @exception CacheException
> >   -     * @exception InvalidHandleException
> >   +     *@param  name                        Key of object to reset
> attributes for
> >   +     *@param  attr                        New attributes for the
> object
> >   +     *@exception  CacheException
> >   +     *@exception  InvalidHandleException
> >         */
> >        public void resetElementAttributes( Object name, Attributes
attr
> )
> >   -        throws CacheException, InvalidHandleException
> >   -    {
> >   +        throws CacheException, InvalidHandleException
> >   +    {
> >            // Not implemented
> >        }
> >
> >        /**
> >   -     * GetAttributes will return an attribute object describing
the
> current
> >   -     * attributes associated with the object name.
> >   +     *  GetAttributes will return an attribute object describing
the
> current
> >   +     *  attributes associated with the object name.
> >         *
> >   -     * @return Attributes for this region
> >   -     * @exception CacheException
> >   +     *@return                     Attributes for this region
> >   +     *@exception  CacheException
> >         */
> >        public Attributes getElementAttributes()
> >            throws CacheException
> >   @@ -375,19 +428,20 @@
> >        }
> >
> >        /**
> >   -     * GetAttributes will return an attribute object describing
the
> current
> >   -     * attributes associated with the object name. The name
object
> must
> >   -     * override the Object.equals and Object.hashCode methods.
> >   -     *
> >   -     * @param name Key of object to get attributes for
> >   -     * @return Attributes for the object, null if object not in
cache
> >   -     * @exception CacheException
> >   +     *  GetAttributes will return an attribute object describing
the
> current
> >   +     *  attributes associated with the object name. The name
object
> must
> >   +     *  override the Object.equals and Object.hashCode methods.
> >   +     *
> >   +     *@param  name                Key of object to get attributes
for
> >   +     *@return                     Attributes for the object, null
if
> object not
> >   +     *      in cache
> >   +     *@exception  CacheException
> >         */
> >        public Attributes getElementAttributes( Object name )
> >            throws CacheException
> >        {
> >            Attributes attr = null;
> >   -
> >   +
> >            try
> >            {
> >                attr = cacheControl.getElementAttributes( (
Serializable
> ) name );
> >   @@ -396,12 +450,12 @@
> >            {
> >                p( ioe.toString() );
> >            }
> >   -
> >   +
> >            return attr;
> >        }
> >
> >        /**
> >   -     * Dispose this region. Flushes objects to and closes
auxiliary
> caches.
> >   +     *  Dispose this region. Flushes objects to and closes
auxiliary
> caches.
> >         */
> >        protected void dispose()
> >        {
> >   @@ -409,9 +463,9 @@
> >        }
> >
> >        /**
> >   -     * Return statistics for the region.
> >   +     *  Return statistics for the region.
> >         *
> >   -     * @return HTML formatted string containing region statistics
> >   +     *@return    HTML formatted string containing region
statistics
> >         */
> >        protected String getStats()
> >        {
> >   @@ -419,25 +473,45 @@
> >        }
> >
> >        /**
> >   -     * Wrapper to System.out.println
> >   +     *  Wrapper to System.out.println FIXME: Replace (at call
points)
> with
> >   +     *  logging mechanism.
> >         *
> >   -     * FIXME: Replace (at call points) with logging mechanism.
> >   -     *
> >   -     * @param s String to print
> >   +     *@param  s  String to print
> >         */
> >        public static void p( String s )
> >        {
> >            System.out.println( s );
> >        }
> >   -
> >   +
> >   +
> >   +    /**
> >   +     *  Gets the ICompositeCacheAttributes of the cache region
> >   +     *
> >   +     *@return
> >   +     */
> >   +    public ICompositeCacheAttributes getCacheAttributes()
> >   +    {
> >   +        return cacheControl.getCacheAttributes();
> >   +    }
> >   +
> >   +    /**
> >   +     *  Sets the ICompositeCacheAttributes of the cache region.
> >   +     *
> >   +     *@param  cattr  The new ICompositeCacheAttribute value
> >   +     */
> >   +    public void setCacheAttributes( ICompositeCacheAttributes
cattr )
> >   +    {
> >   +        cacheControl.setCacheAttributes( cattr );
> >   +    }
> >   +
> >        // -------------------------------- methods for testing and
error
> reporting
> >   -
> >   -    // protected void dumpMap()
> >   +
> >   +    // protected void dumpMap()
> >        // {
> >        //     cache_control.dumpMap();
> >        // }
> >        //
> >   -    // protected void dumpCacheEntries()
> >   +    // protected void dumpCacheEntries()
> >        // {
> >        //     cache_control.dumpCacheEntries();
> >        // }
> >
> >
> >
> >   1.6       +2 -2      jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache
.j
> ava
> >
> >   Index: LRUMemoryCache.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/engine/memory/lru/LRUMemoryCache
.j
> ava,v
> >   retrieving revision 1.5
> >   retrieving revision 1.6
> >   diff -u -r1.5 -r1.6
> >   --- LRUMemoryCache.java	13 Feb 2002 04:45:05 -0000	1.5
> >   +++ LRUMemoryCache.java	14 Feb 2002 05:30:51 -0000	1.6
> >   @@ -30,8 +30,8 @@
> >
> >    /////////////////////////////////////////////////////
> >    /**
> >   - *  A fast reference management system. The least recently used
items
> move tot
> >   - *  he end of the list and get spooled to disk if the cache hub
is
> configured to
> >   + *  A fast reference management system. The least recently used
items
> move to
> >   + *  the end of the list and get spooled to disk if the cache hub
is
> configured to
> >     *  use a disk cache. Most of the cache bottelnecks ar ein IO.
There
> are no io
> >     *  bottlenecks here, it's all about processing power. Even
though
> there are
> >     *  only a few adjustments necessary to maintain the double
linked
> list, we
> >
> >
> >
> >   1.4       +43 -40    jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/JCS.java
> >
> >   Index: JCS.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/JCS.java,v
> >   retrieving revision 1.3
> >   retrieving revision 1.4
> >   diff -u -r1.3 -r1.4
> >   --- JCS.java	13 Feb 2002 03:01:05 -0000	1.3
> >   +++ JCS.java	14 Feb 2002 05:30:51 -0000	1.4
> >   @@ -11,28 +11,28 @@
> >     * are met:
> >     *
> >     * 1. Redistributions of source code must retain the above
copyright
> >   - *    notice, this list of conditions and the following
disclaimer.
> >   + * notice, this list of conditions and the following disclaimer.
> >     *
> >     * 2. Redistributions in binary form must reproduce the above
> copyright
> >   - *    notice, this list of conditions and the following
disclaimer in
> >   - *    the documentation and/or other materials provided with the
> >   - *    distribution.
> >   + * notice, this list of conditions and the following disclaimer
in
> >   + * the documentation and/or other materials provided with the
> >   + * distribution.
> >     *
> >     * 3. The end-user documentation included with the
redistribution, if
> >   - *    any, must include the following acknowlegement:
> >   - *       "This product includes software developed by the
> >   - *        Apache Software Foundation (http://www.apache.org/)."
> >   - *    Alternately, this acknowlegement may appear in the software
> itself,
> >   - *    if and wherever such third-party acknowlegements normally
> appear.
> >   + * any, must include the following acknowlegement:
> >   + * "This product includes software developed by the
> >   + * Apache Software Foundation (http://www.apache.org/)."
> >   + * Alternately, this acknowlegement may appear in the software
> itself,
> >   + * if and wherever such third-party acknowlegements normally
appear.
> >     *
> >     * 4. The names "The Jakarta Project", "Velocity", and "Apache
> Software
> >   - *    Foundation" must not be used to endorse or promote products
> derived
> >   - *    from this software without prior written permission. For
> written
> >   - *    permission, please contact apache@apache.org.
> >   + * Foundation" must not be used to endorse or promote products
> derived
> >   + * from this software without prior written permission. For
written
> >   + * permission, please contact apache@apache.org.
> >     *
> >     * 5. Products derived from this software may not be called
"Apache"
> >   - *    nor may "Apache" appear in their names without prior
written
> >   - *    permission of the Apache Group.
> >   + * nor may "Apache" appear in their names without prior written
> >   + * permission of the Apache Group.
> >     *
> >     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR
IMPLIED
> >     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES
> >   @@ -66,23 +66,26 @@
> >    import
> org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
> >
> >    /**
> >   - * Simple class for using JCS. To use JCS in your application,
you
> can use the
> >   - * static methods of this class to get access objects (instances
of
> this class)
> >   - * for your cache regions. Ideally this class should be all you
need
> to import
> >   - * to use JCS.
> >   - *
> >   - * @author <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
> >   - * @author <a href="mailto:jtaylor@apache.org">James Taylor</a>
> >   - * @version $Id: JCS.java,v 1.3 2002/02/13 03:01:05 jtaylor Exp $
> >   + *  Simple class for using JCS. To use JCS in your application,
you
> can use the
> >   + *  static methods of this class to get access objects (instances
of
> this class)
> >   + *  for your cache regions. Ideally this class should be all you
need
> to import
> >   + *  to use JCS. One JCS should be created for each region you
want to
> access. If
> >   + *  you have several regions, then get instances for each. For
best
> performance
> >   + *  the getInstance call should be made in an initialization
method.
> >   + *
> >   + *@author     <a href="mailto:asmuts@yahoo.com">Aaron Smuts</a>
> >   + *@author     <a href="mailto:jtaylor@apache.org">James
Taylor</a>
> >   + *@created    February 13, 2002
> >   + *@version    $Id: JCS.java,v 1.4 2002/02/14 05:30:51 asmuts Exp
$
> >     */
> >    public class JCS extends GroupCacheAccess
> >    {
> >        private static GroupCacheManager cacheMgr;
> >
> >        /**
> >   -     * Protected constructor for use by the static factory
methods.
> >   +     *  Protected constructor for use by the static factory
methods.
> >         *
> >   -     * @param cacheControl Cache which the instance will provide
> access to
> >   +     *@param  cacheControl  Cache which the instance will provide
> access to
> >         */
> >        protected JCS( Cache cacheControl )
> >        {
> >   @@ -90,29 +93,30 @@
> >        }
> >
> >        /**
> >   -     * Get a JCS which accesses the provided region.
> >   +     *  Get a JCS which accesses the provided region.
> >         *
> >   -     * @param region Region that return JCS will provide access
to
> >   -     * @return A JCS which provides access to a given region.
> >   -     * @exception CacheException
> >   +     *@param  region              Region that return JCS will
provide
> access to
> >   +     *@return                     A JCS which provides access to
a
> given region.
> >   +     *@exception  CacheException
> >         */
> >        public static JCS getInstance( String region )
> >            throws CacheException
> >        {
> >            ensureCacheManager();
> >   -
> >   +
> >            return new JCS( ( Cache ) cacheMgr.getCache( region ) );
> >   +
> >        }
> >
> >        /**
> >   -     * Get a JCS which accesses the provided region.
> >   +     *  Get a JCS which accesses the provided region.
> >         *
> >   -     * @param region Region that return JCS will provide access
to
> >   -     * @param icca Cache attributes for region
> >   -     * @return A JCS which provides access to a given region.
> >   -     * @exception CacheException
> >   +     *@param  region              Region that return JCS will
provide
> access to
> >   +     *@param  icca                Cache attributes for region
> >   +     *@return                     A JCS which provides access to
a
> given region.
> >   +     *@exception  CacheException
> >         */
> >   -    public static JCS getInstance( String region,
> >   +    public static JCS getInstance( String region,
> >                                       ICompositeCacheAttributes icca
)
> >            throws CacheException
> >        {
> >   @@ -122,11 +126,10 @@
> >        }
> >
> >        /**
> >   -     * Gets an instance of GroupCacheManager and stores it in the
> cacheMgr
> >   -     * class field, if it is not already set. Unlike the
> implementation in
> >   -     * CacheAccess, the cache manager is a GroupCacheManager.
> >   -     *
> >   -     * NOTE: This can / will be moved up into GroupCacheAccess.
> >   +     *  Gets an instance of GroupCacheManager and stores it in
the
> cacheMgr
> >   +     *  class field, if it is not already set. Unlike the
> implementation in
> >   +     *  CacheAccess, the cache manager is a GroupCacheManager.
NOTE:
> This can
> >   +     *  will be moved up into GroupCacheAccess.
> >         */
> >        protected static void ensureCacheManager()
> >        {
> >
> >
> >
> >   1.6       +71 -26    jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.jav
a
> >
> >   Index: ICacheAccess.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
>
stratum/src/java/org/apache/stratum/jcs/access/behavior/ICacheAccess.jav
a,
> v
> >   retrieving revision 1.5
> >   retrieving revision 1.6
> >   diff -u -r1.5 -r1.6
> >   --- ICacheAccess.java	15 Jan 2002 22:25:50 -0000	1.5
> >   +++ ICacheAccess.java	14 Feb 2002 05:30:51 -0000	1.6
> >   @@ -11,28 +11,28 @@
> >     * are met:
> >     *
> >     * 1. Redistributions of source code must retain the above
copyright
> >   - *    notice, this list of conditions and the following
disclaimer.
> >   + * notice, this list of conditions and the following disclaimer.
> >     *
> >     * 2. Redistributions in binary form must reproduce the above
> copyright
> >   - *    notice, this list of conditions and the following
disclaimer in
> >   - *    the documentation and/or other materials provided with the
> >   - *    distribution.
> >   + * notice, this list of conditions and the following disclaimer
in
> >   + * the documentation and/or other materials provided with the
> >   + * distribution.
> >     *
> >     * 3. The end-user documentation included with the
redistribution, if
> >   - *    any, must include the following acknowlegement:
> >   - *       "This product includes software developed by the
> >   - *        Apache Software Foundation (http://www.apache.org/)."
> >   - *    Alternately, this acknowlegement may appear in the software
> itself,
> >   - *    if and wherever such third-party acknowlegements normally
> appear.
> >   + * any, must include the following acknowlegement:
> >   + * "This product includes software developed by the
> >   + * Apache Software Foundation (http://www.apache.org/)."
> >   + * Alternately, this acknowlegement may appear in the software
> itself,
> >   + * if and wherever such third-party acknowlegements normally
appear.
> >     *
> >     * 4. The names "The Jakarta Project", "Velocity", and "Apache
> Software
> >   - *    Foundation" must not be used to endorse or promote products
> derived
> >   - *    from this software without prior written permission. For
> written
> >   - *    permission, please contact apache@apache.org.
> >   + * Foundation" must not be used to endorse or promote products
> derived
> >   + * from this software without prior written permission. For
written
> >   + * permission, please contact apache@apache.org.
> >     *
> >     * 5. Products derived from this software may not be called
"Apache"
> >   - *    nor may "Apache" appear in their names without prior
written
> >   - *    permission of the Apache Group.
> >   + * nor may "Apache" appear in their names without prior written
> >   + * permission of the Apache Group.
> >     *
> >     * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR
IMPLIED
> >     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES
> >   @@ -57,7 +57,8 @@
> >    import java.io.Serializable;
> >
> >    import org.apache.stratum.jcs.access.exception.CacheException;
> >   -
> >   +import
org.apache.stratum.jcs.access.exception.ObjectExistsException;
> >   +import
> org.apache.stratum.jcs.engine.behavior.ICompositeCacheAttributes;
> >    import org.apache.stratum.jcs.engine.Attributes;
> >
> >    /////////////////////////////////////////////////////////
> >   @@ -92,6 +93,16 @@
> >
> >
> >        /**
> >   +     *  Puts in cache if an item does not exist with the name in
that
> region.
> >   +     *
> >   +     *@param  name                Description of the Parameter
> >   +     *@param  obj                 Description of the Parameter
> >   +     *@exception  CacheException  Description of the Exception
> >   +     */
> >   +    void putSafe( Object name, Object obj )
> >   +        throws CacheException;
> >   +
> >   +    /**
> >         *  Puts and/or overides an element with the name in that
region.
> >         *
> >         *@param  name                Description of the Parameter
> >   @@ -118,36 +129,55 @@
> >         *  Removes an item or all items. Should be called remove.
> >         *
> >         *@exception  CacheException  Description of the Exception
> >   +     *@deprecated
> >   +     *@see                        #remove
> >         */
> >        void destroy()
> >            throws CacheException;
> >
> >   -
> >        /**
> >         *  Description of the Method
> >         *
> >   -     *@param  name                Description of the Parameter
> >         *@exception  CacheException  Description of the Exception
> >         */
> >   -    void destroy( Object name )
> >   +    void remove()
> >            throws CacheException;
> >
> >   -
> >        /**
> >   -     *  Remove either the entire region of elements or the the
> specified element
> >   -     *  from other caches specified in in the cache.properties
file
> as lateral
> >   -     *  caches.
> >   +     *  Description of the Method
> >   +     *
> >   +     *@param  name                Description of the Parameter
> >   +     *@exception  CacheException  Description of the Exception
> >   +     *@deprecated
> >   +     *@see                        #remove
> >         */
> >   -    void removeLateralDirect();
> >   -
> >   +    void destroy( Object name )
> >   +        throws CacheException;
> >
> >        /**
> >         *  Description of the Method
> >         *
> >   -     *@param  key  Description of the Parameter
> >   +     *@param  name                Description of the Parameter
> >   +     *@exception  CacheException  Description of the Exception
> >         */
> >   -    void removeLateralDirect( Serializable key );
> >   +    void remove( Object name )
> >   +        throws CacheException;
> >
> >   +//    /**
> >   +//     *  Remove either the entire region of elements or the the
> specified element
> >   +//     *  from other caches specified in in the cache.properties
file
> as lateral
> >   +//     *  caches.
> >   +//     */
> >   +//    void removeLateralDirect();
> >   +//
> >   +//
> >   +//    /**
> >   +//     *  Description of the Method
> >   +//     *
> >   +//     *@param  key  Description of the Parameter
> >   +//     */
> >   +//    void removeLateralDirect( Serializable key );
> >   +//
> >
> >        /**
> >         *  ResetAttributes allows for some of the attributes of a
region
> to be
> >   @@ -199,6 +229,21 @@
> >         */
> >        Attributes getElementAttributes( Object name )
> >            throws CacheException;
> >   +
> >   +
> >   +    /**
> >   +     *  Gets the ICompositeCacheAttributes of the cache region
> >   +     *
> >   +     *@return
> >   +     */
> >   +    public ICompositeCacheAttributes getCacheAttributes();
> >   +
> >   +    /**
> >   +     *  Sets the ICompositeCacheAttributes of the cache region
> >   +     *
> >   +     *@param  cattr  The new ICompositeCacheAttribute value
> >   +     */
> >   +    public void setCacheAttributes( ICompositeCacheAttributes
cattr
> );
> >
> >    }
> >    // end interface
> >
> >
> >
> >   1.13      +80 -29    jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java
> >
> >   Index: Cache.java
> >
===================================================================
> >   RCS file: /home/cvs/jakarta-turbine-
> stratum/src/java/org/apache/stratum/jcs/engine/control/Cache.java,v
> >   retrieving revision 1.12
> >   retrieving revision 1.13
> >   diff -u -r1.12 -r1.13
> >   --- Cache.java	13 Feb 2002 19:13:59 -0000	1.12
> >   +++ Cache.java	14 Feb 2002 05:30:51 -0000	1.13
> >   @@ -62,6 +62,7 @@
> >
> >    import org.apache.stratum.jcs.access.exception.CacheException;
> >    import
> org.apache.stratum.jcs.access.exception.ObjectNotFoundException;
> >   +import
org.apache.stratum.jcs.access.exception.ObjectExistsException;
> >
> >    import org.apache.stratum.jcs.engine.Attributes;
> >    import org.apache.stratum.jcs.engine.CacheElement;
> >   @@ -88,13 +89,13 @@
> >     *@author     asmuts
> >     *@created    January 15, 2002
> >     */
> >   -public class Cache
> >   -    implements ICacheHub, ICache, ICompositeCache, Serializable
> >   +public class Cache
> >   +     implements ICacheHub, ICache, ICompositeCache, Serializable
> >    {
> >   -    private static final Log log = LogSource.getInstance(
Cache.class
> );
> >   -
> >   +    private final static Log log = LogSource.getInstance(
Cache.class
> );
> >   +
> >        /**
> >   -     *  Description of the Field
> >   +     *  not used for much
> >         */
> >        public final String className;
> >
> >   @@ -105,15 +106,16 @@
> >
> >        private boolean alive = true;
> >
> >   +    // this is int he cacheAttr, shouldn't be used, remove
> >        final String cacheName;
> >
> >        /**
> >   -     *  Region Elemental Attributes
> >   +     *  Region Elemental Attributes, default
> >         */
> >        public Attributes attr;
> >
> >        /**
> >   -     *  Cache Attributes
> >   +     *  Cache Attributes, for hub and memory auxiliary
> >         */
> >        public ICompositeCacheAttributes cacheAttr;
> >
> >   @@ -124,6 +126,11 @@
> >        private int ramHit;
> >        private int miss;
> >
> >   +    /**
> >   +     *  The cache hub can only have one memory cache. This could
be
> made more
> >   +     *  flexible in the future, but they are tied closely
together.
> More than
> >   +     *  one doesn't make much sense.
> >   +     */
> >        // IMemoryCache
> >        IMemoryCache memCache;
> >
> >   @@ -173,9 +180,9 @@
> >
> >            if ( log.isDebugEnabled() )
> >            {
> >   -            log.debug( "Constructed cache with name " + cacheName
+
> >   -                       " and cache attributes: " + cattr );
> >   -        }
> >   +            log.debug( "Constructed cache with name " + cacheName
+
> >   +                " and cache attributes: " + cattr );
> >   +        }
> >            else if ( log.isInfoEnabled() )
> >            {
> >                log.info( "Constructed cache with name: " + cacheName
);
> >   @@ -186,7 +193,9 @@
> >        /**
> >         *  Description of the Method
> >         *
> >   -     *@param  ce  Description of the Parameter
> >   +     *@param  ce     Description of the Parameter
> >   +     *@deprecated
> >   +     *@see           this will become protected
> >         */
> >        public void add( ICacheElement ce )
> >        {
> >   @@ -203,7 +212,29 @@
> >
> >
> >        /**
> >   -     *  OSC4j interface put methods, and make it the first in the
> link list.
> >   +     *  Will no override existing items.
> >   +     *
> >   +     *@param  key              Description of the Parameter
> >   +     *@param  val              Description of the Parameter
> >   +     *@exception  IOException  Description of the Exception
> >   +     */
> >   +    public void putSafe( Serializable key, Serializable val )
> >   +        throws IOException, ObjectExistsException
> >   +    {
> >   +        if ( this.get( key ) != null )
> >   +        {
> >   +            throw new ObjectExistsException( "Object exists for
key "
> + key );
> >   +        }
> >   +        else
> >   +        {
> >   +            put( key, val, ( Attributes ) this.attr.copy() );
> >   +        }
> >   +        return;
> >   +    }
> >   +
> >   +
> >   +    /**
> >   +     *  Put in cache and configured auxiliaries.
> >         *
> >         *@param  key              Description of the Parameter
> >         *@param  val              Description of the Parameter
> >   @@ -234,18 +265,18 @@
> >            //if ( this.get( key ) != null ) {
> >            //  throw new ObjectExistsException( "Object exists for
key "
> + key );
> >            //}
> >   -
> >   +
> >            if ( key == null || val == null )
> >            {
> >   -            NullPointerException npe =
> >   -                new NullPointerException( "key=" + key + " and
val="
> + val +
> >   -                                          " must not be null." );
> >   -
> >   +            NullPointerException npe =
> >   +                new NullPointerException( "key=" + key + " and
val="
> + val +
> >   +                " must not be null." );
> >   +
> >                log.error( "Key or value was null. Exception will be
> thrown", npe );
> >   -
> >   +
> >                throw npe;
> >            }
> >   -
> >   +
> >            try
> >            {
> >                updateCaches( key, val, attr );
> >   @@ -271,7 +302,7 @@
> >            throws IOException
> >        {
> >            // FIXME: Replace with tracing aspects
> >   -
> >   +
> >            if ( log.isDebugEnabled() )
> >            {
> >                log.debug( "updateCaches(key,val,attr) >
> ICache.INCLUDE_REMOTE_CACHE= " + ICache.INCLUDE_REMOTE_CACHE + " key =
" +
> key );
> >   @@ -296,7 +327,7 @@
> >            throws IOException
> >        {
> >            // FIXME: Replace with tracing aspects
> >   -
> >   +
> >            if ( log.isDebugEnabled() )
> >            {
> >                log.debug(
"updateCaches(key,val,attr,updateRemoteCache)
> > updateRemoteCache= " + updateRemoteCache + " key = " + key );
> >   @@ -319,7 +350,7 @@
> >            throws IOException
> >        {
> >            // FIXME: Replace with tracing aspects
> >   -
> >   +
> >            if ( log.isDebugEnabled() )
> >            {
> >                log.debug( "update(ce) > ICache.INCLUDE_REMOTE_CACHE=
" +
> ICache.INCLUDE_REMOTE_CACHE + " key = " + ce.getKey() );
> >   @@ -359,11 +390,11 @@
> >                throw new IllegalArgumentException(
> >                    "key must not end with " +
NAME_COMPONENT_DELIMITER +
> " for a put operation" );
> >            }
> >   -
> >   +
> >            // FIXME: Replace with tracing aspects
> >
> >            if ( log.isDebugEnabled() )
> >   -        {
> >   +        {
> >                log.debug( "Cache.updateExclude(ce,updateRemoteCache)
>
> updateRemoteCache = " + updateRemoteCache + " key=" + ce.getKey() + ",
> value type=" + ce.getVal().getClass().getName() + ", " +
> ce.getAttributes().toString() );
> >
> >                if ( updateRemoteCache == ICache.INCLUDE_REMOTE_CACHE
)
> >   @@ -392,7 +423,7 @@
> >            for ( int i = 0; i < auxCaches.length; i++ )
> >            {
> >                ICache aux = auxCaches[i];
> >   -
> >   +
> >                if ( log.isDebugEnabled() )
> >                {
> >                    log.debug( "aux.getCacheType() = " +
> aux.getCacheType() );
> >   @@ -433,8 +464,8 @@
> >                    // restrictions
> >                    if ( log.isDebugEnabled() )
> >                    {
> >   -                    log.debug( "lateralcache in aux list: cattr "
+
> >   -                               cacheAttr.getUseLateral() );
> >   +                    log.debug( "lateralcache in aux list: cattr "
+
> >   +                        cacheAttr.getUseLateral() );
> >                    }
> >                    if ( cacheAttr.getUseLateral() &&
> ce.getAttributes().IS_LATERAL && updateRemoteCache )
> >                    {
> >   @@ -682,7 +713,7 @@
> >                    if ( log.isInfoEnabled() )
> >                    {
> >                        log.info( ce.getKey() + " expired" );
> >   -                }
> >   +                }
> >
> >                    this.remove( key );
> >                    //throw new ObjectNotFoundException( key + "
expired
> from cache" );
> >   @@ -1078,7 +1109,7 @@
> >
> >        ////////////////////////////////////////////////
> >        /**
> >   -     *  Gets the attributes attribute of the Cache object
> >   +     *  Gets the default element attribute of the Cache object
> >         *
> >         *@return    The attributes value
> >         */
> >   @@ -1087,6 +1118,26 @@
> >            return attr;
> >        }
> >
> >   +
> >   +    /**
> >   +     *  Gets the ICompositeCacheAttributes attribute of the Cache
> object
> >   +     *
> >   +     *@return    The ICompositeCacheAttributes value
> >   +     */
> >   +    public ICompositeCacheAttributes getCacheAttributes()
> >   +    {
> >   +        return this.cacheAttr;
> >   +    }
> >   +
> >   +    /**
> >   +     *  Sets the ICompositeCacheAttributes attribute of the Cache
> object
> >   +     *
> >   +     *@param  cattr  The new ICompositeCacheAttributes value
> >   +     */
> >   +    public void setCacheAttributes( ICompositeCacheAttributes
cattr )
> >   +    {
> >   +        this.cacheAttr = cattr;
> >   +    }
> >
> >        ////////////////////////////////////////////////
> >        /**
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:turbine-dev-
> unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:turbine-dev-
> help@jakarta.apache.org>
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-dev-
> help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>