From cocoonvanessapratt@example.net Fri Feb 01 13:27:34 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 11603 invoked by uid 500); 1 Feb 2002 13:27:34 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 11592 invoked by uid 500); 1 Feb 2002 13:27:33 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 13:27:33 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/jispstore JispFilesystemStore.java MRUMemoryStore.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 05:27:33 Modified: . changes.xml src/java/org/apache/cocoon/components/store FilesystemStore.java MRUMemoryStore.java MemoryStore.java Store.java StoreJanitorImpl.java src/scratchpad/src/org/apache/cocoon/jispstore JispFilesystemStore.java MRUMemoryStore.java Log: Add size() to the Store interface Revision Changes Path 1.91 +4 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.90 retrieving revision 1.91 diff -u -r1.90 -r1.91 --- changes.xml 31 Jan 2002 19:42:41 -0000 1.90 +++ changes.xml 1 Feb 2002 13:27:32 -0000 1.91 @@ -4,7 +4,7 @@ <!-- History of Cocoon changes - $Id: changes.xml,v 1.90 2002/01/31 19:42:41 stefano Exp $ + $Id: changes.xml,v 1.91 2002/02/01 13:27:32 vgritsenko Exp $ --> <changes title="History of Changes"> @@ -31,6 +31,9 @@ </devs> <release version="@version@" date="@date@"> + <action dev="VG" type="add"> + Added size() method to the Store interface. + </action> <action dev="GP" type="fixed"> Prevent PostInputStream from looping if the available() method of the base InputStream is returning 0. 1.3 +25 -4 xml-cocoon2/src/java/org/apache/cocoon/components/store/FilesystemStore.java Index: FilesystemStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/FilesystemStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FilesystemStore.java 22 Jan 2002 00:17:12 -0000 1.2 +++ FilesystemStore.java 1 Feb 2002 13:27:32 -0000 1.3 @@ -169,23 +169,44 @@ /** * Returns the list of stored files as an Enumeration of Files */ - public Enumeration keys() { + public Enumeration keys() { final FSEnumeration enum = new FSEnumeration(); this.addKeys(enum, this.directoryFile); return enum; } - protected void addKeys(FSEnumeration enum, - File directory) { + /** + * Returns count of the objects in the store, or -1 if could not be + * obtained. + */ + public int size() { + return countKeys(this.directoryFile); + } + + protected void addKeys(FSEnumeration enum, File directory) { final int subStringBegin = this.directoryFile.getAbsolutePath().length() + 1; final File[] files = directory.listFiles(); - for(int i=0; i<files.length; i++) { + for (int i=0; i<files.length; i++) { if (files[i].isDirectory()) { this.addKeys(enum, files[i]); } else { enum.add(files[i].getAbsolutePath().substring(subStringBegin)); } } + } + + protected int countKeys(File directory) { + int count = 0; + final int subStringBegin = this.directoryFile.getAbsolutePath().length() + 1; + final File[] files = directory.listFiles(); + for (int i=0; i<files.length; i++) { + if (files[i].isDirectory()) { + count += this.countKeys(files[i]); + } else { + count ++; + } + } + return count; } final class FSEnumeration implements Enumeration { 1.6 +9 -0 xml-cocoon2/src/java/org/apache/cocoon/components/store/MRUMemoryStore.java Index: MRUMemoryStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/MRUMemoryStore.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- MRUMemoryStore.java 29 Jan 2002 19:39:54 -0000 1.5 +++ MRUMemoryStore.java 1 Feb 2002 13:27:32 -0000 1.6 @@ -286,6 +286,15 @@ } /** + * Returns count of the objects in the store, or -1 if could not be + * obtained. + */ + public int size() + { + return this.cache.size(); + } + + /** * Frees some of the fast memory used by this store. * It removes the last element in the store. */ 1.2 +10 -1 xml-cocoon2/src/java/org/apache/cocoon/components/store/MemoryStore.java Index: MemoryStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/MemoryStore.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- MemoryStore.java 3 Jan 2002 12:31:14 -0000 1.1 +++ MemoryStore.java 1 Feb 2002 13:27:32 -0000 1.2 @@ -20,7 +20,7 @@ * (Apache Software Foundation) * @author <a href="mailto:vanessapratt@example.net">Pierpaolo Fumagalli</a> * (Apache Software Foundation, Exoffice Technologies) - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:14 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 13:27:32 $ */ public class MemoryStore implements Store, ThreadSafe { /* WARNING: Hashtable is threadsafe, whereas HashMap is not. @@ -82,5 +82,14 @@ */ public Enumeration keys() { return(table.keys()); + } + + /** + * Returns count of the objects in the store, or -1 if could not be + * obtained. + */ + public int size() + { + return table.size(); } } 1.2 +6 -1 xml-cocoon2/src/java/org/apache/cocoon/components/store/Store.java Index: Store.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/Store.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Store.java 3 Jan 2002 12:31:14 -0000 1.1 +++ Store.java 1 Feb 2002 13:27:32 -0000 1.2 @@ -20,7 +20,7 @@ * (Apache Software Foundation) * @author <a href="mailto:vanessapratt@example.net">Pierpaolo Fumagalli</a> * (Apache Software Foundation, Exoffice Technologies) - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:14 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 13:27:32 $ */ public interface Store extends Component { @@ -62,4 +62,9 @@ */ Enumeration keys(); + /** + * Returns count of the objects in the store, or -1 if could not be + * obtained. + */ + int size(); } 1.7 +8 -21 xml-cocoon2/src/java/org/apache/cocoon/components/store/StoreJanitorImpl.java Index: StoreJanitorImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/StoreJanitorImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- StoreJanitorImpl.java 28 Jan 2002 19:57:52 -0000 1.6 +++ StoreJanitorImpl.java 1 Feb 2002 13:27:32 -0000 1.7 @@ -44,7 +44,7 @@ private ArrayList storelist; private int index = -1; private static boolean doRun = false; - private int m_percent; + private double fraction; /** * Initialize the StoreJanitorImpl. @@ -71,7 +71,7 @@ this.setCleanupthreadinterval(params.getParameterAsInteger("cleanupthreadinterval",10)); this.setPriority(params.getParameterAsInteger( "threadpriority", Thread.currentThread().getPriority())); - this.m_percent = params.getParameterAsInteger( "percent_to_free",10); + int percent = params.getParameterAsInteger("percent_to_free", 10); if ((this.getFreememory() < 1)) { throw new ConfigurationException("StoreJanitorImpl freememory parameter has to be greater then 1"); @@ -85,10 +85,11 @@ if ((this.getPriority() < 1)) { throw new ConfigurationException("StoreJanitorImpl threadpriority has to be greater then 1"); } - if ((this.m_percent > 100 && this.m_percent < 1)) { + if ((percent > 100 && percent < 1)) { throw new ConfigurationException("StoreJanitorImpl percent_to_free, has to be between 1 and 100"); } + this.fraction = percent / 100.0; this.setStoreList(new ArrayList()); } @@ -281,26 +282,12 @@ * @return number of elements to be removed! */ private int calcToFree(Store store) { - int cnt = 0; - try { - this.getLogger().debug("Calculating percentage!"); - Enumeration enum = store.keys(); - - while(enum.hasMoreElements()) { - cnt++; - enum.nextElement(); - } - - this.getLogger().debug("Counted: " + cnt); - double fac = new Integer(this.m_percent).doubleValue() / 100; - double dcnt = new Integer(cnt).doubleValue(); - this.getLogger().debug("Calculated: " + new Double(dcnt * fac).intValue()); - - return new Double(dcnt * fac).intValue(); - } catch (Exception e) { - this.getLogger().error("",e); + int cnt = store.size(); + if (cnt < 0) { + getLogger().debug("Unknown size of the store: " + store); return 0; } + return (int)(cnt * fraction); } /** 1.5 +5 -0 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/jispstore/JispFilesystemStore.java Index: JispFilesystemStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/jispstore/JispFilesystemStore.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- JispFilesystemStore.java 15 Jan 2002 18:16:16 -0000 1.4 +++ JispFilesystemStore.java 1 Feb 2002 13:27:32 -0000 1.5 @@ -337,6 +337,11 @@ return null; } + public int size() { + //TODO: Implementation + return 0; + } + /** * This method wraps around the key Object a Jisp KeyObject. * 1.5 +4 -0 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/jispstore/MRUMemoryStore.java Index: MRUMemoryStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/jispstore/MRUMemoryStore.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- MRUMemoryStore.java 15 Jan 2002 18:16:16 -0000 1.4 +++ MRUMemoryStore.java 1 Feb 2002 13:27:32 -0000 1.5 @@ -235,6 +235,10 @@ return this.mCache.keys(); } + public int size() { + return this.mCache.size(); + } + /** * Frees some of the fast memory used by this store. It removes the last * element in the store. ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:19:55 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 40195 invoked by uid 500); 1 Feb 2002 14:19:53 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 40186 invoked by uid 500); 1 Feb 2002 14:19:53 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:19:53 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation ComposerGenerator.java HTMLGenerator.java SearchGenerator.java ServletGenerator.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 06:19:53 Modified: src/java/org/apache/cocoon/generation ComposerGenerator.java HTMLGenerator.java SearchGenerator.java ServletGenerator.java Log: Have Composer generator imlement Disposable also. Revision Changes Path 1.2 +12 -4 xml-cocoon2/src/java/org/apache/cocoon/generation/ComposerGenerator.java Index: ComposerGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ComposerGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ComposerGenerator.java 3 Jan 2002 12:31:16 -0000 1.1 +++ ComposerGenerator.java 1 Feb 2002 14:19:53 -0000 1.2 @@ -7,6 +7,7 @@ *****************************************************************************/ package org.apache.cocoon.generation; +import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.Composable; @@ -15,19 +16,26 @@ * * @author <a href="mailto:vanessapratt@example.net">Pierpaolo Fumagalli</a> * (Apache Software Foundation, Exoffice Technologies) - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:16 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 14:19:53 $ */ public abstract class ComposerGenerator extends AbstractGenerator -implements Composable { +implements Composable, Disposable { /** The component manager instance */ - protected ComponentManager manager=null; + protected ComponentManager manager = null; /** * Set the current <code>ComponentManager</code> instance used by this * <code>Composable</code>. */ public void compose(ComponentManager manager) throws ComponentException { - this.manager=manager; + this.manager = manager; + } + + /** + * Release all resources. + */ + public void dispose() { + this.manager = null; } } 1.3 +2 -1 xml-cocoon2/src/java/org/apache/cocoon/generation/HTMLGenerator.java Index: HTMLGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/HTMLGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- HTMLGenerator.java 21 Jan 2002 23:14:26 -0000 1.2 +++ HTMLGenerator.java 1 Feb 2002 14:19:53 -0000 1.3 @@ -46,7 +46,7 @@ * @author <a href="mailto:vanessapratt@example.net">Davanum Srinivas</a> * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> * @author <a href="mailto:vanessapratt@example.net">Nicola Ken Barozzi</a> - * @version CVS $Revision: 1.2 $ $Date: 2002/01/21 23:14:26 $ + * @version CVS $Revision: 1.3 $ $Date: 2002/02/01 14:19:53 $ */ public class HTMLGenerator extends ComposerGenerator implements Cacheable, Recyclable, Composable, Disposable { @@ -227,5 +227,6 @@ public void dispose() { this.manager.release((Component)this.processor); + super.dispose(); } } 1.3 +2 -1 xml-cocoon2/src/java/org/apache/cocoon/generation/SearchGenerator.java Index: SearchGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/SearchGenerator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SearchGenerator.java 24 Jan 2002 03:20:25 -0000 1.2 +++ SearchGenerator.java 1 Feb 2002 14:19:53 -0000 1.3 @@ -79,7 +79,7 @@ * * @author <a href="mailto:vanessapratt@example.net">Bernhard Huber</a> * @author <a href="mailto:vanessapratt@example.net">Vadim Gritsenko</a> - * @version CVS $Id: SearchGenerator.java,v 1.2 2002/01/24 03:20:25 vgritsenko Exp $ + * @version CVS $Id: SearchGenerator.java,v 1.3 2002/02/01 14:19:53 vgritsenko Exp $ */ public class SearchGenerator extends ComposerGenerator implements Recyclable, Contextualizable, Initializable, Disposable @@ -808,6 +808,7 @@ // this.manager.release(lcs); // lcs = null; // } + super.dispose(); } } 1.2 +4 -4 xml-cocoon2/src/java/org/apache/cocoon/generation/ServletGenerator.java Index: ServletGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ServletGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ServletGenerator.java 3 Jan 2002 12:31:16 -0000 1.1 +++ ServletGenerator.java 1 Feb 2002 14:19:53 -0000 1.2 @@ -7,14 +7,15 @@ *****************************************************************************/ package org.apache.cocoon.generation; -import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.parameters.Parameters; + import org.apache.cocoon.Constants; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.environment.Context; import org.apache.cocoon.environment.Request; import org.apache.cocoon.environment.Response; import org.apache.cocoon.environment.SourceResolver; + import org.xml.sax.SAXException; import java.io.IOException; @@ -23,10 +24,9 @@ /** * * @author <a href="mailto:vanessapratt@example.net">Giacomo Pati</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:16 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 14:19:53 $ */ -public abstract class ServletGenerator extends ComposerGenerator -implements Composable { +public abstract class ServletGenerator extends ComposerGenerator { protected Request request=null; protected Response response=null; ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:40:48 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 52467 invoked by uid 500); 1 Feb 2002 14:40:46 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 52454 invoked by uid 500); 1 Feb 2002 14:40:46 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:40:45 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/store MRUMemoryStore.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 02/02/01 06:40:45 Modified: src/java/org/apache/cocoon/components/store MRUMemoryStore.java Log: Remove unnecessary import Revision Changes Path 1.7 +0 -2 xml-cocoon2/src/java/org/apache/cocoon/components/store/MRUMemoryStore.java Index: MRUMemoryStore.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/store/MRUMemoryStore.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MRUMemoryStore.java 1 Feb 2002 13:27:32 -0000 1.6 +++ MRUMemoryStore.java 1 Feb 2002 14:40:45 -0000 1.7 @@ -25,8 +25,6 @@ import org.apache.cocoon.Constants; import org.apache.cocoon.util.ClassUtils; import org.apache.cocoon.util.IOUtils; -import org.apache.regexp.RE; -import org.apache.regexp.RESyntaxException; import java.io.File; import java.io.IOException; ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:41:39 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 53249 invoked by uid 500); 1 Feb 2002 14:41:39 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 53240 invoked by uid 500); 1 Feb 2002 14:41:39 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:41:39 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/crawler SimpleCocoonCrawlerImpl.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 06:41:38 Modified: src/java/org/apache/cocoon/components/crawler SimpleCocoonCrawlerImpl.java Log: Minor debug/formatting changes Revision Changes Path 1.3 +18 -18 xml-cocoon2/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java Index: SimpleCocoonCrawlerImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SimpleCocoonCrawlerImpl.java 23 Jan 2002 19:06:38 -0000 1.2 +++ SimpleCocoonCrawlerImpl.java 1 Feb 2002 14:41:38 -0000 1.3 @@ -13,7 +13,6 @@ import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.logger.AbstractLoggable; import org.apache.avalon.framework.parameters.Parameters; -import org.apache.avalon.framework.thread.ThreadSafe; import org.apache.avalon.excalibur.pool.Recyclable; @@ -40,10 +39,10 @@ * A simple cocoon crawler. * * @author <a href="mailto:vanessapratt@example.net">Bernhard Huber</a> - * @version CVS $Id: SimpleCocoonCrawlerImpl.java,v 1.2 2002/01/23 19:06:38 vgritsenko Exp $ + * @version CVS $Id: SimpleCocoonCrawlerImpl.java,v 1.3 2002/02/01 14:41:38 vgritsenko Exp $ */ public class SimpleCocoonCrawlerImpl extends AbstractLoggable - implements CocoonCrawler, Configurable, Disposable, Recyclable + implements CocoonCrawler, Configurable, Disposable, Recyclable { /** @@ -206,10 +205,14 @@ this.includeCrawlingURL.add(new RE(tokenized_pattern)); } } catch (RESyntaxException rese) { - getLogger().error("Cannot create includeing regular-expression for " + - pattern, rese); + getLogger().error("Cannot create including regular-expression for " + + pattern, rese); } } + } else { + if (getLogger().isDebugEnabled()) { + getLogger().debug("Include all URLs"); + } } children = configuration.getChildren(EXCLUDE_CONFIG); @@ -225,12 +228,15 @@ } } catch (RESyntaxException rese) { getLogger().error("Cannot create excluding regular-expression for " + - pattern, rese); + pattern, rese); } } } else { excludeCrawlingURL = new HashSet(); setDefaultExcludeFromCrawling(); + if (getLogger().isDebugEnabled()) { + getLogger().debug("Exclude default URLs only"); + } } Configuration child; @@ -487,11 +493,8 @@ * @since */ private boolean isExcludedURL(String url) { - // by default include URL for crawling + // by default do not exclude URL for crawling if (excludeCrawlingURL == null) { - if (getLogger().isDebugEnabled()) { - getLogger().debug("exclude no URL " + url); - } return false; } @@ -501,13 +504,13 @@ RE pattern = (RE) i.next(); if (pattern.match(s)) { if (getLogger().isDebugEnabled()) { - getLogger().debug("exclude URL " + url); + getLogger().debug("Excluded URL " + url); } return true; } } if (getLogger().isDebugEnabled()) { - getLogger().debug("exclude not URL " + url); + getLogger().debug("Not excluded URL " + url); } return false; } @@ -523,9 +526,6 @@ private boolean isIncludedURL(String url) { // by default include URL for crawling if (includeCrawlingURL == null) { - if (getLogger().isDebugEnabled()) { - getLogger().debug("include all URL " + url); - } return true; } @@ -535,13 +535,13 @@ RE pattern = (RE) i.next(); if (pattern.match(s)) { if (getLogger().isDebugEnabled()) { - getLogger().debug("include URL " + url); + getLogger().debug("Included URL " + url); } return true; } } if (getLogger().isDebugEnabled()) { - getLogger().debug("include not URL " + url); + getLogger().debug("Not included URL " + url); } return false; } @@ -555,7 +555,7 @@ * </p> * * @author <a href="mailto:vanessapratt@example.net>Bernhard Huber</a> - * @version $Id: SimpleCocoonCrawlerImpl.java,v 1.2 2002/01/23 19:06:38 vgritsenko Exp $ + * @version $Id: SimpleCocoonCrawlerImpl.java,v 1.3 2002/02/01 14:41:38 vgritsenko Exp $ */ public static class CocoonCrawlerIterator implements Iterator { ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:44:35 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 55748 invoked by uid 500); 1 Feb 2002 14:44:34 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 55736 invoked by uid 500); 1 Feb 2002 14:44:34 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:44:34 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/xscript XScriptManagerImpl.java XScriptObject.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 06:44:34 Modified: src/java/org/apache/cocoon/components/profiler ProfilerGenerator.java src/java/org/apache/cocoon/components/xscript XScriptManagerImpl.java XScriptObject.java Log: XScriptManager supposed to be ThreadSafe - otherwise all this GLOBAL_SCOPE does not make any sence Revision Changes Path 1.2 +2 -1 xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerGenerator.java Index: ProfilerGenerator.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/profiler/ProfilerGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ProfilerGenerator.java 3 Jan 2002 12:31:12 -0000 1.1 +++ ProfilerGenerator.java 1 Feb 2002 14:44:34 -0000 1.2 @@ -26,7 +26,7 @@ * Generates an XML representation of the current status of Profiler. * * @author <a href="mailto:vanessapratt@example.net">Vadim Gritsenko</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:12 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 14:44:34 $ */ public class ProfilerGenerator extends ComposerGenerator implements Recyclable, Composable, Disposable { @@ -56,6 +56,7 @@ super.manager.release(this.profiler); this.profiler = null; } + super.dispose(); } /** 1.3 +31 -45 xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptManagerImpl.java Index: XScriptManagerImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptManagerImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XScriptManagerImpl.java 22 Jan 2002 00:17:12 -0000 1.2 +++ XScriptManagerImpl.java 1 Feb 2002 14:44:34 -0000 1.3 @@ -13,6 +13,7 @@ import org.apache.avalon.framework.logger.AbstractLoggable; import org.apache.avalon.framework.parameters.Parameters; +import org.apache.avalon.framework.parameters.Parameterizable; import org.apache.avalon.framework.parameters.ParameterException; import org.apache.avalon.framework.component.Component; @@ -20,11 +21,6 @@ import org.apache.avalon.framework.component.ComponentManager; import org.apache.avalon.framework.component.Composable; import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.avalon.excalibur.pool.Poolable; - -import org.apache.avalon.framework.configuration.Configurable; -import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.cocoon.components.xscript.XScriptObjectFromURL; @@ -36,7 +32,7 @@ */ public class XScriptManagerImpl extends AbstractLoggable - implements XScriptManager, Composable, Component, Configurable, Poolable + implements XScriptManager, Composable, Component, Parameterizable, ThreadSafe { /** * The global scope. All the global variables are indexed in this @@ -65,8 +61,7 @@ */ protected ComponentManager manager = null; - public void compose(ComponentManager manager) - throws ComponentException + public void compose(ComponentManager manager) throws ComponentException { this.manager = manager; getLogger().debug("XScriptManager component initialized."); @@ -76,26 +71,17 @@ { try { object.compose(manager); - } - catch (ComponentException ex) { + } catch (ComponentException ex) { } } - public void configure(Configuration conf) - throws ConfigurationException + public void parameterize(Parameters params) throws ParameterException { - try { - Parameters params = Parameters.fromConfiguration(conf); - String[] names = params.getNames(); - for (int i = 0; i < names.length; i++) { - String resourceString = params.getParameter(names[i]); - XScriptObject resource = new XScriptObjectFromURL(this, resourceString); - globalScope.put(names[i], resource); - } - } - catch (ParameterException ex) { - throw new ConfigurationException("Error configuring XScriptManager: ", - ex); + String[] names = params.getNames(); + for (int i = 0; i < names.length; i++) { + String resourceString = params.getParameter(names[i]); + XScriptObject resource = new XScriptObjectFromURL(this, resourceString); + globalScope.put(names[i], resource); } } @@ -122,14 +108,13 @@ public XScriptObject get(String name, int scope, String context) throws IllegalArgumentException { - if (scope == XScriptManager.GLOBAL_SCOPE) + if (scope == XScriptManager.GLOBAL_SCOPE) { return globalScope.get(name); - else if (scope == XScriptManager.SESSION_SCOPE) { + } else if (scope == XScriptManager.SESSION_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)sessionScope.get(context); if (s != null) return s.get(name); - } - else if (scope == XScriptManager.PAGE_SCOPE) { + } else if (scope == XScriptManager.PAGE_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)pageScope.get(context); if (s != null) return s.get(name); @@ -149,8 +134,9 @@ scope = (XScriptVariableScope)sessionScope.get(sessionContext); if (scope != null) { synchronized(scope) { - if (scope.defines(name)) + if (scope.defines(name)) { return scope.get(name); + } } } @@ -158,15 +144,17 @@ scope = (XScriptVariableScope)pageScope.get(pageContext); if (scope != null) { synchronized(scope) { - if (scope.defines(name)) + if (scope.defines(name)) { return scope.get(name); + } } } // No luck finding `name' in the page scope, try the global scope. synchronized(globalScope) { - if (globalScope.defines(name)) + if (globalScope.defines(name)) { return globalScope.get(name); + } } // No variable `name' found, throw an exception. @@ -178,25 +166,23 @@ { if (scope == XScriptManager.GLOBAL_SCOPE) { globalScope.put(name, value); - } - else if (scope == XScriptManager.SESSION_SCOPE) { + } else if (scope == XScriptManager.SESSION_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)sessionScope.get(context); if (s == null) { s = new XScriptVariableScope(); sessionScope.put(context, s); } s.put(name, value); - } - else if (scope == XScriptManager.PAGE_SCOPE) { + } else if (scope == XScriptManager.PAGE_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)pageScope.get(context); if (s == null) { s = new XScriptVariableScope(); pageScope.put(context, s); } s.put(name, value); - } - else + } else { throw createAccessException("create", name, scope, context); + } } public void remove(String name, int scope, String context) @@ -204,19 +190,19 @@ { if (scope == XScriptManager.GLOBAL_SCOPE) { globalScope.remove(name); - } - else if (scope == XScriptManager.SESSION_SCOPE) { + } else if (scope == XScriptManager.SESSION_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)sessionScope.get(context); - if (s != null) + if (s != null) { s.remove(name); - } - else if (scope == XScriptManager.PAGE_SCOPE) { + } + } else if (scope == XScriptManager.PAGE_SCOPE) { XScriptVariableScope s = (XScriptVariableScope)pageScope.get(context); - if (s != null) + if (s != null) { s.remove(name); - } - else + } + } else { throw createAccessException("remove", name, scope, context); + } } public void removeFirst(String name, 1.3 +1 -1 xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObject.java Index: XScriptObject.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObject.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XScriptObject.java 25 Jan 2002 03:41:13 -0000 1.2 +++ XScriptObject.java 1 Feb 2002 14:44:34 -0000 1.3 @@ -92,7 +92,7 @@ transformer.transform(this, stylesheet, params, result); - componentManager.release((Component)transformer); + componentManager.release(transformer); return new XScriptObjectResult(xscriptManager, writer.toString()); } ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:48:37 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 58769 invoked by uid 500); 1 Feb 2002 14:48:37 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 58760 invoked by uid 500); 1 Feb 2002 14:48:37 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:48:36 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation I18nTransformer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 02/02/01 06:48:36 Modified: src/java/org/apache/cocoon/transformation I18nTransformer.java Log: Output the key value if the translation is not found and there's no <untranslated-text> configuration Revision Changes Path 1.6 +5 -5 xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java Index: I18nTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- I18nTransformer.java 30 Jan 2002 14:56:12 -0000 1.5 +++ I18nTransformer.java 1 Feb 2002 14:48:36 -0000 1.6 @@ -129,8 +129,8 @@ * catalogue (<i>mandatory</i>). * <li><strong>catalogue-location</strong>: location of the * message catalogues (<i>mandatory</i>). - * <li><strong>untranslated-text</strong>: default text used for - * untranslated keys (default is 'untranslated-text'). + * <li><strong>untranslated-text</strong>: text used for + * untranslated keys (default is to output the key name). * <li><strong>cache-at-startup</strong>: flag whether to cache * messages at startup (false by default). * </ul> @@ -670,7 +670,7 @@ // obtain default text to use for untranslated messages child = conf.getChild(I18N_UNTRANSLATED); - untranslated = child.getValue(I18N_UNTRANSLATED); + untranslated = child.getValue(null); debug("Default untranslated text is '" + untranslated + "'"); // obtain config option, whether to cache messages at startup time @@ -1032,7 +1032,7 @@ // reset the key holding variable current_key = null; } else { // use text value as dictionary key - translated_text = getString(textValue, untranslated); + translated_text = getString(textValue, (untranslated == null) ? textValue : untranslated); } break; @@ -1097,7 +1097,7 @@ int attr_index = temp_attr.getIndex(attr_name); if (attr_index != -1) { String text2translate = temp_attr.getValue(attr_index); - String result = getString(text2translate, untranslated); + String result = getString(text2translate, (untranslated == null) ? text2translate : untranslated); // set the translated value if (result != null) { ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:53:48 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 63907 invoked by uid 500); 1 Feb 2002 14:53:47 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 63897 invoked by uid 500); 1 Feb 2002 14:53:47 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:53:47 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java xscript.xsl X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 06:53:47 Modified: . changes.xml src/java/org/apache/cocoon/components/language/markup/xsp/java xscript.xsl Log: XScript fixes Revision Changes Path 1.92 +6 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- changes.xml 1 Feb 2002 13:27:32 -0000 1.91 +++ changes.xml 1 Feb 2002 14:53:46 -0000 1.92 @@ -4,7 +4,7 @@ <!-- History of Cocoon changes - $Id: changes.xml,v 1.91 2002/02/01 13:27:32 vgritsenko Exp $ + $Id: changes.xml,v 1.92 2002/02/01 14:53:46 vgritsenko Exp $ --> <changes title="History of Changes"> @@ -31,6 +31,11 @@ </devs> <release version="@version@" date="@date@"> + <action dev="VG" type="fix"> + Fixed memory leaks in XScript engine. Fixed global and session scope + variables: now they are shared between XScript pages as it should be. + Page scope variables now visible for all instances of the same page. + </action> <action dev="VG" type="add"> Added size() method to the Store interface. </action> 1.2 +11 -7 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl Index: xscript.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- xscript.xsl 3 Jan 2002 12:31:11 -0000 1.1 +++ xscript.xsl 1 Feb 2002 14:53:47 -0000 1.2 @@ -25,17 +25,21 @@ </xsp:structure> <xsp:logic> - </xsp:logic> - - <xsp:init-page> XScriptManager xscriptManager; - try { + + public void compose(ComponentManager manager) throws ComponentException { + super.compose(manager); xscriptManager = (XScriptManager)this.manager.lookup(XScriptManager.ROLE); } - catch (ComponentException ex) { - throw new ProcessingException(ex); + + public void dispose() { + if (xscriptManager != null) { + manager.release((Component)xscriptManager); + xscriptManager = null; + } + super.dispose(); } - </xsp:init-page> + </xsp:logic> <xsl:apply-templates/> </xsp:page> ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 14:57:28 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 66144 invoked by uid 500); 1 Feb 2002 14:57:27 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 66128 invoked by uid 500); 1 Feb 2002 14:57:27 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 14:57:27 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap MatchNodeBuilder.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 02/02/01 06:57:27 Modified: src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap MatchNodeBuilder.java Log: Allow empty <map:match> : this can be used to block some URIs (like **.xmap) Revision Changes Path 1.3 +1 -7 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap/MatchNodeBuilder.java Index: MatchNodeBuilder.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/treeprocessor/sitemap/MatchNodeBuilder.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- MatchNodeBuilder.java 15 Jan 2002 11:10:54 -0000 1.2 +++ MatchNodeBuilder.java 1 Feb 2002 14:57:27 -0000 1.3 @@ -27,7 +27,7 @@ /** * * @author <a href="mailto:vanessapratt@example.net">Sylvain Wallez</a> - * @version CVS $Revision: 1.2 $ $Date: 2002/01/15 11:10:54 $ + * @version CVS $Revision: 1.3 $ $Date: 2002/02/01 14:57:27 $ */ public class MatchNodeBuilder extends AbstractParentProcessingNodeBuilder @@ -74,12 +74,6 @@ // Get all children ProcessingNode[] children = buildChildNodes(config); - if (children.length == 0) { - String msg = "There must be at least one child in match at " + config.getLocation(); - getLogger().error(msg); - throw new ConfigurationException(msg); - } - node.setChildren(children); return node; ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 15:01:34 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 71718 invoked by uid 500); 1 Feb 2002 15:01:34 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 71707 invoked by uid 500); 1 Feb 2002 15:01:33 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 15:01:33 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation FragmentExtractorTransformer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N vgritsenko 02/02/01 07:01:33 Modified: src/java/org/apache/cocoon/transformation FragmentExtractorTransformer.java Log: Make constants final; prevent (possible in future) reconfiguration bugs Revision Changes Path 1.7 +47 -45 xml-cocoon2/src/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java Index: FragmentExtractorTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/FragmentExtractorTransformer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- FragmentExtractorTransformer.java 31 Jan 2002 11:16:11 -0000 1.6 +++ FragmentExtractorTransformer.java 1 Feb 2002 15:01:33 -0000 1.7 @@ -17,6 +17,7 @@ import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.parameters.Parameters; + import org.apache.cocoon.ProcessingException; import org.apache.cocoon.caching.CacheValidity; import org.apache.cocoon.caching.Cacheable; @@ -26,6 +27,7 @@ import org.apache.cocoon.generation.FragmentExtractorGenerator; import org.apache.cocoon.xml.dom.DOMBuilder; import org.apache.cocoon.xml.dom.DOMFactory; + import org.w3c.dom.Document; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -37,13 +39,14 @@ import java.util.Map; -/** The transformation half of the FragmentExtractor. - * This transformer sieves an incoming stream of xml +/** + * The transformation half of the FragmentExtractor. + * This transformer sieves an incoming stream of xml * and replaces fragments with an xlink locator pointing to the fragments. * <p> * The extracted fragments are idendified by their element name and namespace URI. * The default is to extract SVG images ("svg" elements in namespace - * "http://www.w3.org/2000/svg"), but this can be overriden in the configuration : + * "http://www.w3.org/2000/svg"), but this can be overriden in the configuration: * <pre> * &lt;extract-uri&gt;http://my/namespace/uri&lt;/extract-uri&gt; * &lt;extract-element&gt;my-element&lt;/extract-element&gt; @@ -53,19 +56,22 @@ * and the associated generator are very likely to fail on a clustered server.</b> * * @author <a href="mailto:vanessapratt@example.net">Paul Russell</a> - * @version CVS $Revision: 1.6 $ $Date: 2002/01/31 11:16:11 $ + * @version CVS $Revision: 1.7 $ $Date: 2002/02/01 15:01:33 $ */ public class FragmentExtractorTransformer extends AbstractTransformer implements Composable, Disposable, Cacheable, Poolable, Configurable { - private String extractURI = "http://www.w3.org/2000/svg"; - private String extractElement = "svg"; + private static final String EXTRACT_URI_NAME = "extract-uri"; + private static final String EXTRACT_ELEMENT_NAME = "extract-element"; + + private static final String EXTRACT_URI = "http://www.w3.org/2000/svg"; + private static final String EXTRACT_ELEMENT = "svg"; - private final static String EXTRACT_URI_NAME = "extract-uri"; - private final static String EXTRACT_ELEMENT_NAME = "extract-element"; + private static final String FE_URI = "http://apache.org/cocoon/fragmentextractor/2.0"; + private static final String XLINK_URI = "http://www.w3c.org/1999/xlink"; - private static String FE_URI = "http://apache.org/cocoon/fragmentextractor/2.0"; - private static String XLINK_URI = "http://www.w3c.org/1999/xlink"; + private String extractURI; + private String extractElement; private static String generatorClass = "org.apache.cocoon.generation.FragmentExtractorGenerator"; @@ -87,16 +93,13 @@ this.documentFactory = (DOMFactory) this.manager.lookup(Parser.ROLE); } - /** + /** * Configure this transformer. */ - public void configure( Configuration conf ) - throws ConfigurationException { - if ( conf != null ) { - - this.extractURI = conf.getChild(EXTRACT_URI_NAME).getValue(this.extractURI); - this.extractElement = conf.getChild(EXTRACT_ELEMENT_NAME).getValue(this.extractElement); - + public void configure(Configuration conf) throws ConfigurationException { + if (conf != null) { + this.extractURI = conf.getChild(EXTRACT_URI_NAME).getValue(EXTRACT_URI); + this.extractElement = conf.getChild(EXTRACT_ELEMENT_NAME).getValue(EXTRACT_ELEMENT); if (getLogger().isDebugEnabled()) { getLogger().debug("Extraction URI is " + this.extractURI); getLogger().debug("Extraction element is " + this.extractElement); @@ -104,8 +107,7 @@ } } - /** Setup the transformer. - */ + /** Setup the transformer. */ public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) throws ProcessingException, SAXException, IOException { extractLevel = 0; @@ -136,16 +138,14 @@ /** * Receive notification of the beginning of a document. */ - public void startDocument() - throws SAXException { + public void startDocument() throws SAXException { super.startDocument(); } /** * Receive notification of the end of a document. */ - public void endDocument() - throws SAXException { + public void endDocument() throws SAXException { super.endDocument(); } @@ -157,7 +157,7 @@ */ public void startPrefixMapping(String prefix, String uri) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.startPrefixMapping(prefix,uri); prefixMap.put(prefix,uri); } else { @@ -172,7 +172,7 @@ */ public void endPrefixMapping(String prefix) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.endPrefixMapping(prefix); prefixMap.remove(prefix); } else { @@ -195,7 +195,7 @@ */ public void startElement(String uri, String loc, String raw, Attributes a) throws SAXException { - if ( this.extractURI.equals(uri) && this.extractElement.equals(loc) ) { + if (this.extractURI.equals(uri) && this.extractElement.equals(loc)) { extractLevel++; fragmentID++; getLogger().debug("FragmentExtractorTransformer extractLevel now " + extractLevel + "."); @@ -204,7 +204,7 @@ this.currentBuilder = new DOMBuilder(documentFactory); this.currentBuilder.startDocument(); Iterator itt = prefixMap.entrySet().iterator(); - while ( itt.hasNext() ) { + while (itt.hasNext()) { Map.Entry entry = (Map.Entry)itt.next(); this.currentBuilder.startPrefixMapping( (String)entry.getKey(), @@ -213,7 +213,7 @@ } } - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.startElement(uri,loc,raw,a); } else { this.currentBuilder.startElement(uri,loc,raw,a); @@ -234,18 +234,18 @@ */ public void endElement(String uri, String loc, String raw) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.endElement(uri,loc,raw); } else { this.currentBuilder.endElement(uri,loc,raw); - if ( this.extractURI.equals(uri) && this.extractElement.equals(loc) ) { + if (this.extractURI.equals(uri) && this.extractElement.equals(loc)) { extractLevel--; getLogger().debug("FragmentExtractorTransformer extractLevel now " + extractLevel + "."); - if ( extractLevel == 0 ) { + if (extractLevel == 0) { // finish building the DOM. remove existing prefix mappings. Iterator itt = prefixMap.entrySet().iterator(); - while ( itt.hasNext() ) { + while (itt.hasNext()) { Map.Entry entry = (Map.Entry) itt.next(); this.currentBuilder.endPrefixMapping( (String)entry.getKey() @@ -258,7 +258,7 @@ getLogger().debug("FragmentExtractorTransformer stored document " + id + "."); // Insert ref. - super.startPrefixMapping("fe",FE_URI); + super.startPrefixMapping("fe", FE_URI); AttributesImpl atts = new AttributesImpl(); atts.addAttribute(null,"fragment-id","fragment-id","CDATA",id); super.startElement(FE_URI,"fragment","fe:fragment",atts); @@ -278,7 +278,7 @@ */ public void characters(char c[], int start, int len) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.characters(c,start,len); } else { this.currentBuilder.characters(c,start,len); @@ -294,7 +294,7 @@ */ public void ignorableWhitespace(char c[], int start, int len) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.ignorableWhitespace(c,start,len); } else { this.currentBuilder.ignorableWhitespace(c,start,len); @@ -310,7 +310,7 @@ */ public void processingInstruction(String target, String data) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.processingInstruction(target,data); } else { this.currentBuilder.processingInstruction(target,data); @@ -325,7 +325,7 @@ */ public void skippedEntity(String name) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.skippedEntity(name); } else { this.currentBuilder.skippedEntity(name); @@ -343,7 +343,7 @@ */ public void startDTD(String name, String publicId, String systemId) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.startDTD(name,publicId,systemId); } else { throw new SAXException( @@ -357,7 +357,7 @@ */ public void endDTD() throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.endDTD(); } else { throw new SAXException( @@ -374,7 +374,7 @@ */ public void startEntity(String name) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.startEntity(name); } else { this.currentBuilder.startEntity(name); @@ -388,7 +388,7 @@ */ public void endEntity(String name) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.endEntity(name); } else { this.currentBuilder.endEntity(name); @@ -400,7 +400,7 @@ */ public void startCDATA() throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.startCDATA(); } else { this.currentBuilder.startCDATA(); @@ -412,7 +412,7 @@ */ public void endCDATA() throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.endCDATA(); } else { this.currentBuilder.endCDATA(); @@ -428,7 +428,7 @@ */ public void comment(char ch[], int start, int len) throws SAXException { - if ( extractLevel == 0 ) { + if (extractLevel == 0) { super.comment(ch,start,len); } else { this.currentBuilder.comment(ch,start,len); @@ -441,5 +441,7 @@ public void dispose() { if(this.documentFactory!=null) this.manager.release((Component) this.documentFactory); this.documentFactory = null; + + this.manager = null; } } ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 15:14:57 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 79602 invoked by uid 500); 1 Feb 2002 15:14:55 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 79587 invoked by uid 500); 1 Feb 2002 15:14:55 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 15:14:54 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper EnvironmentWrapper.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 02/02/01 07:14:54 Modified: . changes.xml src/java/org/apache/cocoon/components/source SitemapSource.java src/java/org/apache/cocoon/environment/wrapper EnvironmentWrapper.java Log: Calling getInputStream() on a "cocoon:" source now returns the same output as an external call instead of always using an XML serializer. This also allows to get internally data produced by a Reader. Revision Changes Path 1.93 +6 -1 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- changes.xml 1 Feb 2002 14:53:46 -0000 1.92 +++ changes.xml 1 Feb 2002 15:14:54 -0000 1.93 @@ -4,7 +4,7 @@ <!-- History of Cocoon changes - $Id: changes.xml,v 1.92 2002/02/01 14:53:46 vgritsenko Exp $ + $Id: changes.xml,v 1.93 2002/02/01 15:14:54 sylvain Exp $ --> <changes title="History of Changes"> @@ -31,6 +31,11 @@ </devs> <release version="@version@" date="@date@"> + <action dev="SW" type="update"> + Calling getInputStream() on a "cocoon:" source now returns the same output + as an external call instead of always using an XML serializer. + This also allows to get internally data produced by a Reader. + </action> <action dev="VG" type="fix"> Fixed memory leaks in XScript engine. Fixed global and session scope variables: now they are shared between XScript pages as it should be. 1.4 +14 -15 xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- SitemapSource.java 31 Jan 2002 16:44:23 -0000 1.3 +++ SitemapSource.java 1 Feb 2002 15:14:54 -0000 1.4 @@ -39,13 +39,14 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.util.Map; /** * Description of a source which is defined by a pipeline. * * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version CVS $Revision: 1.3 $ $Date: 2002/01/31 16:44:23 $ + * @version CVS $Revision: 1.4 $ $Date: 2002/02/01 15:14:54 $ */ public final class SitemapSource @@ -170,7 +171,8 @@ * Return an <code>InputStream</code> object to read from the source. */ public InputStream getInputStream() - throws ProcessingException, IOException { + throws ProcessingException, IOException { + if (this.needsRefresh) { this.refresh(); } @@ -178,27 +180,24 @@ if (this.exception != null) { throw this.exception; } - ComponentSelector serializerSelector = null; - Serializer serializer = null; + + if (this.redirectSource != null) { + return this.redirectSource.getInputStream(); + } + try { - - serializerSelector = (ComponentSelector) this.manager.lookup(Serializer.ROLE + "Selector"); - serializer = (Serializer)serializerSelector.select("xml"); ByteArrayOutputStream os = new ByteArrayOutputStream(); - serializer.setOutputStream(os); - - this.toSAX(serializer); - + this.environment.setOutputStream(os); + this.pipeline.process(this.environment); return new ByteArrayInputStream(os.toByteArray()); - } catch (ComponentException cme) { - throw new ProcessingException("could not lookup pipeline components", cme); + } catch (ProcessingException e) { throw e; } catch (Exception e) { throw new ProcessingException("Exception during processing of " + this.systemId, e); } finally { - if (serializer != null) serializerSelector.release(serializer); - if (serializerSelector != null) this.manager.release(serializerSelector); + // Unhide wrapped environment output stream + this.environment.setOutputStream(null); reset(); } } 1.4 +15 -2 xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java Index: EnvironmentWrapper.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EnvironmentWrapper.java 22 Jan 2002 00:17:13 -0000 1.3 +++ EnvironmentWrapper.java 1 Feb 2002 15:14:54 -0000 1.4 @@ -30,7 +30,7 @@ * contains a <code>RequestWrapper</code> object. * * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version $Id: EnvironmentWrapper.java,v 1.3 2002/01/22 00:17:13 vgritsenko Exp $ + * @version $Id: EnvironmentWrapper.java,v 1.4 2002/02/01 15:14:54 sylvain Exp $ */ public final class EnvironmentWrapper extends AbstractEnvironment @@ -50,10 +50,15 @@ /** The last context */ private URL lastContext; + /** The last prefix */ private String lastPrefix; + /** The last uri */ private String lastURI; + + /** The stream to output to */ + private OutputStream outputStream; /** * Constructs an EnvironmentWrapper object from a Request @@ -121,7 +126,15 @@ */ public OutputStream getOutputStream() throws IOException { - return this.environment.getOutputStream(); + return (this.outputStream == null) ? this.environment.getOutputStream() : this.outputStream; + } + + /** + * Set the output stream for this environment. It hides the one of the + * wrapped environment. + */ + public void setOutputStream(OutputStream stream) { + this.outputStream = stream; } /** ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 15:43:01 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 1043 invoked by uid 500); 1 Feb 2002 15:43:00 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 1033 invoked by uid 500); 1 Feb 2002 15:43:00 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 15:42:59 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp EsqlQuery.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N haul 02/02/01 07:42:59 Modified: src/java/org/apache/cocoon/components/language/markup/xsp EsqlQuery.java Log: fixed comment Revision Changes Path 1.4 +1 -6 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/EsqlQuery.java Index: EsqlQuery.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/EsqlQuery.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- EsqlQuery.java 31 Jan 2002 16:11:33 -0000 1.3 +++ EsqlQuery.java 1 Feb 2002 15:42:59 -0000 1.4 @@ -201,11 +201,6 @@ return this.execute(false); } - /** - * some brain dead DBMSs (Oracle) return their result sets for - * callable statements through the some (i.e. the first) returned - * object. - */ public boolean execute( int resultSetFromObject ) throws SQLException { hasResultSet = this.execute(false); resultSet = (ResultSet) ((CallableStatement) preparedStatement).getObject(1); @@ -214,7 +209,7 @@ } /** - * some other brain dead DBMSs (Informix) don't like their callable + * some brain dead DBMSs (Informix) don't like their callable * statements to be 'execute'd but require 'executeQuery' instead. */ public boolean execute( boolean needsQuery ) throws SQLException { ---------------------------------------------------------------------- In case of troubles, e-mail: vanessapratt@example.net To unsubscribe, e-mail: vanessapratt@example.net For additional commands, e-mail: vanessapratt@example.net From cocoonvanessapratt@example.net Fri Feb 01 15:48:12 2002 Return-Path: <cocoonvanessapratt@example.net> Delivered-To: vanessapratt@example.net Received: (qmail 4749 invoked by uid 500); 1 Feb 2002 15:48:11 -0000 Mailing-List: contact vanessapratt@example.net; run by ezmlm Precedence: bulk Reply-To: vanessapratt@example.net list-help: <mailto:vanessapratt@example.net> list-unsubscribe: <mailto:vanessapratt@example.net> list-post: <mailto:vanessapratt@example.net> Delivered-To: mailing list vanessapratt@example.net Received: (qmail 4740 invoked by uid 500); 1 Feb 2002 15:48:11 -0000 Delivered-To: vanessapratt@example.net Date: 1 Feb 2002 15:48:10 -0000 Message-ID: <vanessapratt@example.net> From: vanessapratt@example.net To: vanessapratt@example.net Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation FragmentExtractorTransformer.java TraxTransformer.java WriteDOMSessionTransformer.java XIncludeTransformer.java XTTransformer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N sylvain 02/02/01 07:48:10 Modified: src/java/org/apache/cocoon Cocoon.java src/java/org/apache/cocoon/acting AbstractComplementaryConfigurableAction.java src/java/org/apache/cocoon/components/deli DeliImpl.java src/java/org/apache/cocoon/components/language/generator GeneratorSelector.java src/java/org/apache/cocoon/components/language/markup/xsp XSPFormValidatorHelper.java src/java/org/apache/cocoon/components/language/programming/java JavaLanguage.java src/java/org/apache/cocoon/components/pipeline CachingEventPipeline.java src/java/org/apache/cocoon/components/sax XMLDeserializer.java XMLSerializer.java src/java/org/apache/cocoon/components/source SourceHandlerImpl.java src/java/org/apache/cocoon/components/xscript XScriptObjectFromURL.java src/java/org/apache/cocoon/components/xslt XSLTProcessor.java XSLTProcessorImpl.java src/java/org/apache/cocoon/generation HTMLGenerator.java ServerPagesGenerator.java StreamGenerator.java src/java/org/apache/cocoon/i18n XMLResourceBundle.java src/java/org/apache/cocoon/reading DatabaseReader.java src/java/org/apache/cocoon/sitemap AbstractSitemap.java Handler.java src/java/org/apache/cocoon/transformation FragmentExtractorTransformer.java TraxTransformer.java WriteDOMSessionTransformer.java XIncludeTransformer.java XTTransformer.java Log: Code cleanup : remove unnecessary casts to Component and null-tests. Revision Changes Path 1.6 +3 -3 xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java Index: Cocoon.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Cocoon.java 22 Jan 2002 00:17:11 -0000 1.5 +++ Cocoon.java 1 Feb 2002 15:48:08 -0000 1.6 @@ -103,7 +103,7 @@ * @author <a href="mailto:vanessapratt@example.net">Pierpaolo Fumagalli</a> (Apache Software Foundation, Exoffice Technologies) * @author <a href="mailto:vanessapratt@example.net">Stefano Mazzocchi</a> * @author <a href="mailto:vanessapratt@example.net">Leo Sutic</a> - * @version CVS $Revision: 1.5 $ $Date: 2002/01/22 00:17:11 $ + * @version CVS $Revision: 1.6 $ $Date: 2002/02/01 15:48:08 $ */ public class Cocoon extends AbstractLoggable @@ -691,8 +691,8 @@ throw e; } finally { environment.setSourceHandler(oldSourceHandler); - if (programGenerator != null) this.componentManager.release(programGenerator); - if (sourceHandler != null) this.componentManager.release((Component) sourceHandler); + this.componentManager.release(programGenerator); + this.componentManager.release(sourceHandler); } } 1.2 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java Index: AbstractComplementaryConfigurableAction.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractComplementaryConfigurableAction.java 3 Jan 2002 12:31:07 -0000 1.1 +++ AbstractComplementaryConfigurableAction.java 1 Feb 2002 15:48:08 -0000 1.2 @@ -28,7 +28,7 @@ * effective. The name of the root configuration element is irrelevant. * * @author <a href="mailto:vanessapratt@example.net">Berin Loritsch</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:07 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:08 $ */ public abstract class AbstractComplementaryConfigurableAction extends ConfigurableComposerAction { private static Map configurations = new HashMap(); @@ -103,7 +103,7 @@ throw new ConfigurationException("Error trying to load configurations for resource: " + (resource == null ? "null" : resource.getSystemId())); } finally { if (resource != null) resource.recycle(); - if (sourceHandler != null) this.manager.release((Component) sourceHandler); + this.manager.release(sourceHandler); } } else { getLogger().debug("Using fixed cached configuration for " + descriptor); 1.9 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java Index: DeliImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/deli/DeliImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DeliImpl.java 30 Jan 2002 17:13:24 -0000 1.8 +++ DeliImpl.java 1 Feb 2002 15:48:08 -0000 1.9 @@ -67,7 +67,7 @@ * A Delivery Context Library for CC/PP and UAProf</a>. * * @author <a href="mailto:vanessapratt@example.net">Mark H. Butler</a> - * @version CVS $ $ $Date: 2002/01/30 17:13:24 $ + * @version CVS $ $ $Date: 2002/02/01 15:48:08 $ */ public final class DeliImpl @@ -127,7 +127,7 @@ /** Dispose of this class */ public void dispose() { - if (parser != null) this.manager.release((Component)parser); + this.manager.release(parser); this.parser = null; } 1.2 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java Index: GeneratorSelector.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/GeneratorSelector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- GeneratorSelector.java 3 Jan 2002 12:31:09 -0000 1.1 +++ GeneratorSelector.java 1 Feb 2002 15:48:08 -0000 1.2 @@ -28,7 +28,7 @@ * includes Sitemaps and XSP Pages * * @author <a href="mailto:vanessapratt@example.net">Berin Loritsch</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:09 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:08 $ */ public class GeneratorSelector extends ExcaliburComponentSelector implements Disposable { @@ -151,7 +151,7 @@ } public void dispose() { - this.manager.release((Component)this.classManager); + this.manager.release(this.classManager); synchronized(this) { 1.2 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java Index: XSPFormValidatorHelper.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XSPFormValidatorHelper.java 3 Jan 2002 12:31:10 -0000 1.1 +++ XSPFormValidatorHelper.java 1 Feb 2002 15:48:09 -0000 1.2 @@ -27,7 +27,7 @@ * The <code>ValidatorActionResult</code> object helper * * @author <a href="mailto:vanessapratt@example.net">Christian Haul</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:10 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:09 $ */ public class XSPFormValidatorHelper { /** @@ -478,7 +478,7 @@ throw new ConfigurationException("Error trying to load configurations for resource: " + source.getSystemId()); } finally { if (source != null) source.recycle(); - if (sourceHandler != null) manager.release((Component) sourceHandler); + manager.release(sourceHandler); } } 1.2 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/java/JavaLanguage.java Index: JavaLanguage.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/programming/java/JavaLanguage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- JavaLanguage.java 3 Jan 2002 12:31:11 -0000 1.1 +++ JavaLanguage.java 1 Feb 2002 15:48:09 -0000 1.2 @@ -31,7 +31,7 @@ * The Java programming language processor * * @author <a href="mailto:vanessapratt@example.net">Ricardo Rocha</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:11 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:09 $ */ public class JavaLanguage extends CompiledProgrammingLanguage implements ThreadSafe, Composable, Disposable { @@ -314,6 +314,6 @@ * dispose */ public void dispose() { - manager.release((Component)this.classLoaderManager); + manager.release(this.classLoaderManager); } } 1.3 +4 -6 xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/CachingEventPipeline.java Index: CachingEventPipeline.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/CachingEventPipeline.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CachingEventPipeline.java 22 Jan 2002 00:17:11 -0000 1.2 +++ CachingEventPipeline.java 1 Feb 2002 15:48:09 -0000 1.3 @@ -41,7 +41,7 @@ * does not cache! (If it would cache, the response would be cached twice!) * * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version CVS $Revision: 1.2 $ $Date: 2002/01/22 00:17:11 $ + * @version CVS $Revision: 1.3 $ $Date: 2002/02/01 15:48:09 $ */ public class CachingEventPipeline extends AbstractEventPipeline @@ -183,8 +183,7 @@ e ); } finally { - if (deserializer != null) - this.manager.release((Component)deserializer); + this.manager.release(deserializer); } } else { getLogger().debug("Cached content is invalid for '" + environment.getURI() + "'."); @@ -215,8 +214,7 @@ } } } finally { - if (xmlSerializer != null) - this.manager.release((Component)xmlSerializer); + this.manager.release(xmlSerializer); } return true; } @@ -387,7 +385,7 @@ } public void dispose() { - this.manager.release((Component)this.eventCache); + this.manager.release(this.eventCache); super.dispose(); } } 1.2 +3 -3 xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLDeserializer.java Index: XMLDeserializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLDeserializer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLDeserializer.java 3 Jan 2002 12:31:13 -0000 1.1 +++ XMLDeserializer.java 1 Feb 2002 15:48:09 -0000 1.2 @@ -7,6 +7,7 @@ *****************************************************************************/ package org.apache.cocoon.components.sax; +import org.apache.avalon.framework.component.Component; import org.apache.cocoon.xml.XMLProducer; import org.xml.sax.SAXException; @@ -22,10 +23,9 @@ * the serialized data. * * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:13 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:09 $ */ -public interface XMLDeserializer -extends XMLProducer { +public interface XMLDeserializer extends XMLProducer, Component { String ROLE = "org.apache.cocoon.components.sax.XMLDeserializer"; 1.2 +3 -2 xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLSerializer.java Index: XMLSerializer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/sax/XMLSerializer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XMLSerializer.java 3 Jan 2002 12:31:13 -0000 1.1 +++ XMLSerializer.java 1 Feb 2002 15:48:09 -0000 1.2 @@ -7,6 +7,7 @@ *****************************************************************************/ package org.apache.cocoon.components.sax; +import org.apache.avalon.framework.component.Component; import org.apache.cocoon.xml.XMLConsumer; /** @@ -17,9 +18,9 @@ * the serialized data. * * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:13 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/02/01 15:48:09 $ */ -public interface XMLSerializer extends XMLConsumer { +public interface XMLSerializer extends XMLConsumer, Component { String ROLE = "org.apache.cocoon.components.sax.XMLSerializer"; /** 1.3 +3 -4 xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceHandlerImpl.java Index: SourceHandlerImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceHandlerImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SourceHandlerImpl.java 22 Jan 2002 00:17:12 -0000 1.2 +++ SourceHandlerImpl.java 1 Feb 2002 15:48:09 -0000 1.3 @@ -36,7 +36,7 @@ /** * @author <a href="mailto:vanessapratt@example.net">Carsten Ziegeler</a> - * @version $Id: SourceHandlerImpl.java,v 1.2 2002/01/22 00:17:12 vgritsenko Exp $ + * @version $Id: SourceHandlerImpl.java,v 1.3 2002/02/01 15:48:09 sylvain Exp $ */ public final class SourceHandlerImpl extends AbstractLoggable @@ -109,9 +109,8 @@ * Dispose */ public void dispose() { - if (this.urlFactory != null) { - this.manager.release((Component)this.urlFactory); - } + this.manager.release(this.urlFactory); + Iterator iter = this.sourceFactories.values().iterator(); SourceFactory current; while (iter.hasNext()) { 1.2 +1 -1 xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObjectFromURL.java Index: XScriptObjectFromURL.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xscript/XScriptObjectFromURL.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- XScriptObjectFromURL.java 3 Jan 2002 12:31:15 -0000 1.1 +++ XScriptObjectFromURL.java 1 Feb 2002 15:48:09 -0000 1.2 @@ -58,7 +58,7 @@ URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); contentLength = conn.getContentLength(); - componentManager.release((Component)urlFactory); + componentManager.release(urlFactory); return is; } 1.3 +2 -1 xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessor.java Index: XSLTProcessor.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- XSLTProcessor.java 23 Jan 2002 00:29:16 -0000 1.2 +++ XSLTProcessor.java 1 Feb 2002 15:48:09 -0000 1.3 @@ -7,6 +7,7 @@ *****************************************************************************/ package org.apache.cocoon.components.xslt; +import org.apache.avalon.framework.component.Component; import org.apache.avalon.framework.parameters.Parameters; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.environment.Source; @@ -23,7 +24,7 @@ * @version 1.0 * @since July 11, 2001 */ -public interface XSLTProcessor +public interface XSLTProcessor extends Component { /** * The role implemented by an <code>XSLTProcessor</code>. 1.9 +1 -1 xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java Index: XSLTProcessorImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XSLTProcessorImpl.java 26 Jan 2002 02:16:49 -0000 1.8 +++ XSLTProcessorImpl.java 1 Feb 2002 15:48:09 -0000 1.9 @@ -114,7 +114,7 @@ */ public void dispose() { if (this.manager != null) {
{'source': 'Apache Software Foundation Public Mail Archives'}