Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 81518 invoked from network); 31 Oct 2003 17:03:24 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 31 Oct 2003 17:03:24 -0000 Received: (qmail 41068 invoked by uid 500); 31 Oct 2003 17:03:17 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 41008 invoked by uid 500); 31 Oct 2003 17:03:16 -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: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 40997 invoked by uid 500); 31 Oct 2003 17:03:16 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 40994 invoked from network); 31 Oct 2003 17:03:16 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 31 Oct 2003 17:03:16 -0000 Received: (qmail 81479 invoked by uid 1758); 31 Oct 2003 17:03:22 -0000 Date: 31 Oct 2003 17:03:22 -0000 Message-ID: <20031031170322.81478.qmail@minotaur.apache.org> From: unico@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/modules/input PropertiesFileModule.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N unico 2003/10/31 09:03:22 Modified: src/java/org/apache/cocoon/components/modules/input PropertiesFileModule.java Log: extend AbstractJXPathModule as suggested by Konstantin Piroumian Revision Changes Path 1.2 +5 -18 cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/PropertiesFileModule.java Index: PropertiesFileModule.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/modules/input/PropertiesFileModule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PropertiesFileModule.java 31 Oct 2003 11:45:55 -0000 1.1 +++ PropertiesFileModule.java 31 Oct 2003 17:03:22 -0000 1.2 @@ -52,14 +52,12 @@ import java.io.IOException; import java.io.InputStream; -import java.util.Iterator; import java.util.Map; import java.util.Properties; import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; -import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.Serviceable; @@ -77,7 +75,7 @@ * * @author Unico Hommes */ -public class PropertiesFileModule extends AbstractLogEnabled +public class PropertiesFileModule extends AbstractJXPathModule implements InputModule, Serviceable, Configurable, ThreadSafe { private SourceResolver m_resolver; @@ -96,6 +94,7 @@ *

*/ public void configure(Configuration configuration) throws ConfigurationException { + super.configure(configuration); String file = configuration.getChild("file").getAttribute("src"); load(file); } @@ -126,22 +125,10 @@ } } - public Object getAttribute(String name,Configuration modeConf,Map objectModel) + protected Object getContextObject(Configuration modeConf, Map objectModel) throws ConfigurationException { - return m_properties.getProperty(name); + return m_properties; } - - public Iterator getAttributeNames(Configuration modeConf, Map objectModel) - throws ConfigurationException { - - return m_properties.keySet().iterator(); - } - - public Object[] getAttributeValues(String name,Configuration modeConf,Map objectModel) - throws ConfigurationException { - - return new Object[] { getAttribute(name,modeConf,objectModel) }; - } - + }