Please can this be applied - it works for me...

Index: conf/TurbineResources.properties
===================================================================
RCS file: /products/cvs/turbine/turbine/conf/TurbineResources.properties,v
retrieving revision 1.22
diff -r1.22 TurbineResources.properties
130c130
< database.adaptor.DBPostgres=postgresql.Driver
---
> database.adaptor.DBPostgres=org.postgresql.Driver
Index: src/java/org/apache/turbine/services/cache/CachedObject.java
===================================================================
RCS file: /products/cvs/turbine/turbine/src/java/org/apache/turbine/services/cac
he/CachedObject.java,v
retrieving revision 1.3
diff -r1.3 CachedObject.java
155a156,164
>      * Resets the expiry clock to indicate this object is valid and in use.
>      *
>      */
>     public void resetExpires()
>     {
>         this.created = System.currentTimeMillis();
>     }
>
>     /**
184a194,230
>
>     /**
>      * Calls all cache listener objects for this object - notifying them that
this object is now stale and out of the cache
>      *
>      */
>     public void cachedObjectFinalizer()
>     {
>         Iterator iter = listeners.iterator();
>         while (iter.hasNext())
>         {
>             CachedObjectListener listener = (CachedObjectListener)iter.next();

>             listener.cachedObjectFinalizer(this);
>         }
>     }
>
>     /** set of listeners */
>     Collection listeners = new ArrayList();
>
>     /**
>      * Adds a cache object listener
>      *
>      */
>     public void addListener(CachedObjectListener listener)
>     {
>         listeners.add(listener);
>     }
>
>     /**
>      * Calls all cache listener objects for this object - notifying them that
this object is now stale and out of the cache
>      *
>      */
>     public void removeListener(CachedObjectListener listener)
>     {
>         listeners.remove(listener);
>     }
>
>
Index: src/java/org/apache/turbine/services/cache/TurbineGlobalCacheService.java

===================================================================
RCS file: /products/cvs/turbine/turbine/src/java/org/apache/turbine/services/cac
he/TurbineGlobalCacheService.java,v
retrieving revision 1.4
diff -r1.4 TurbineGlobalCacheService.java
90c90
<     private Hashtable cache = null;
---
>     private Map cache = null;
208c208,209
<         for ( Enumeration e = cache.elements(); e.hasMoreElements(); )
---
>         //Log.note("pre-cache size = "+cache.size());
>         for ( Iterator e = cache.values().iterator(); e.hasNext(); )
210c211
<             CachedObject co = (CachedObject) e.nextElement();
---
>             CachedObject co = (CachedObject) e.next();
219c220,223
<                     cache.remove ( co );
---
>                 {
>                     e.remove ();
>                     co.cachedObjectFinalizer();
>                 }
221a226
>         //Log.note("post-cache size = "+cache.size());





===================
and a new file in org/apache/turbine/services/cache
CachedObjectListener.java



package org.apache.turbine.services.cache;

/*
 * Copyright (c) 1997-2000 The Java Apache Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    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.
 *
 * 3. All advertising materials mentioning features or use of this
 *    software must display the following acknowledgment:
 *    "This product includes software developed by the Java Apache
 *    Project for use in the Apache JServ servlet engine project
 *    <http://java.apache.org/>."
 *
 * 4. The names "Apache JServ", "Apache JServ Servlet Engine", "Turbine",
 *    "Apache Turbine", "Turbine Project", "Apache Turbine Project" and
 *    "Java Apache Project" must not be used to endorse or promote products
 *    derived from this software without prior written permission.
 *
 * 5. Products derived from this software may not be called "Apache JServ"
 *    nor may "Apache" nor "Apache JServ" appear in their names without
 *    prior written permission of the Java Apache Project.
 *
 * 6. Redistributions of any form whatsoever must retain the following
 *    acknowledgment:
 *    "This product includes software developed by the Java Apache
 *    Project for use in the Apache JServ servlet engine project
 *    <http://java.apache.org/>."
 *
 * THIS SOFTWARE IS PROVIDED BY THE JAVA APACHE PROJECT "AS IS" AND ANY
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE JAVA APACHE PROJECT OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Java Apache Group. For more information
 * on the Java Apache Project and the Apache JServ Servlet Engine project,
 * please see <http://java.apache.org/>.
 *
 */

// Turbine Stuff
import org.apache.turbine.services.Service;
import org.apache.turbine.util.*;

/**
 * Defines things you can listen for relating to CachedObjects
 *
 * @author <a href="mailto:[EMAIL PROTECTED]">Chris Kimpton</a>
 * @version $Id:  $
 */
public interface CachedObjectListener
{

    /**
     * This method is called when an object has been removed from the cache.
     *
     * Use this as a hook to add code to clean up resources, for example, closing a 
database connection
     *
     * @param object the cached object that has just been removed from the cache
     */
    public void cachedObjectFinalizer(CachedObject object);

}
---
"surely it is madness to accept life as it is and not as it could be"
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to