Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 63995 invoked from network); 27 Mar 2007 13:30:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 13:30:01 -0000 Received: (qmail 43475 invoked by uid 500); 27 Mar 2007 13:30:08 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 43425 invoked by uid 500); 27 Mar 2007 13:30:08 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 43412 invoked by uid 99); 27 Mar 2007 13:30:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 06:30:08 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 06:29:59 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B88971A9838; Tue, 27 Mar 2007 06:29:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r522901 - in /cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main: java/org/apache/cocoon/caching/impl/CacheImpl.java resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml Date: Tue, 27 Mar 2007 13:29:39 -0000 To: cvs@cocoon.apache.org From: reinhard@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070327132939.B88971A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Mar 27 06:29:38 2007 New Revision: 522901 URL: http://svn.apache.org/viewvc?view=rev&rev=522901 Log: CacheImpl: avalon->spring Added: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml (with props) Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java Modified: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java?view=diff&rev=522901&r1=522900&r2=522901 ============================================================================== --- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java (original) +++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/java/org/apache/cocoon/caching/impl/CacheImpl.java Tue Mar 27 06:29:38 2007 @@ -19,18 +19,11 @@ import java.io.IOException; import java.io.Serializable; -import org.apache.avalon.framework.activity.Disposable; -import org.apache.avalon.framework.logger.AbstractLogEnabled; -import org.apache.avalon.framework.parameters.ParameterException; -import org.apache.avalon.framework.parameters.Parameterizable; -import org.apache.avalon.framework.parameters.Parameters; -import org.apache.avalon.framework.service.ServiceException; -import org.apache.avalon.framework.service.ServiceManager; -import org.apache.avalon.framework.service.Serviceable; -import org.apache.avalon.framework.thread.ThreadSafe; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.caching.Cache; import org.apache.cocoon.caching.CachedResponse; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.excalibur.store.Store; /** @@ -42,34 +35,13 @@ * @since 2.1 * @version $Id$ */ -public class CacheImpl -extends AbstractLogEnabled -implements Cache, ThreadSafe, Serviceable, Disposable, Parameterizable { +public class CacheImpl implements Cache { + private Log logger = LogFactory.getLog(getClass()); + /** The store containing the cached responses */ protected Store store; - /** The service manager */ - protected ServiceManager manager; - - /** - * Serviceable Interface - */ - public void service (ServiceManager manager) throws ServiceException { - this.manager = manager; - } - - /** - * Disposable Interface - */ - public void dispose() { - if ( this.manager != null ) { - this.manager.release(this.store); - this.store = null; - this.manager = null; - } - } - /** * Store a cached response * @param key the key used by the caching algorithm to identify the @@ -134,17 +106,16 @@ public boolean containsKey(Serializable key) { return this.store.containsKey(key); } - - /* (non-Javadoc) - * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters) + + /** + * Set the Store implementation */ - public void parameterize(Parameters parameters) throws ParameterException { - String storeName = parameters.getParameter("store", Store.ROLE); - try { - this.store = (Store)this.manager.lookup(storeName); - } catch (ServiceException e) { - throw new ParameterException("Unable to lookup store: " + storeName, e); - } + public void setStore(Store store) { + this.store = store; } + + private Log getLogger() { + return this.logger; + } } Added: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml?view=auto&rev=522901 ============================================================================== --- cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml (added) +++ cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml Tue Mar 27 06:29:38 2007 @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file Propchange: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml ------------------------------------------------------------------------------ svn:keywords = Id Propchange: cocoon/trunk/core/cocoon-pipeline/cocoon-pipeline-impl/src/main/resources/META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml