bloritsch 01/12/12 10:34:21 Modified: src/org/apache/cocoon/acting AbstractComplementaryConfigurableAction.java Log: Apply deprecation warning instead of hap-hazardly breaking existing webapps Revision Changes Path 1.15 +23 -15 xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java Index: AbstractComplementaryConfigurableAction.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractComplementaryConfigurableAction.java 2001/12/06 02:59:11 1.14 +++ AbstractComplementaryConfigurableAction.java 2001/12/12 18:34:21 1.15 @@ -28,7 +28,7 @@ * effective. The name of the root configuration element is irrelevant. * * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a> - * @version CVS $Revision: 1.14 $ $Date: 2001/12/06 02:59:11 $ + * @version CVS $Revision: 1.15 $ $Date: 2001/12/12 18:34:21 $ */ public abstract class AbstractComplementaryConfigurableAction extends ConfigurableComposerAction { private static Map configurations = new HashMap(); @@ -42,13 +42,21 @@ * Defaults to reload configuration file it has changed. */ protected Configuration getConfiguration(String descriptor) throws ConfigurationException { - boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT; - if (this.settings.containsKey("reloadable")) - reloadable = Boolean.getBoolean((String) this.settings.get("reloadable")); - return this.getConfiguration(descriptor, null, reloadable); + boolean reloadable = Constants.DESCRIPTOR_RELOADABLE_DEFAULT; + if (this.settings.containsKey("reloadable")) + reloadable = Boolean.getBoolean((String) this.settings.get("reloadable")); + return this.getConfiguration(descriptor, null, reloadable); } /** + * @deprecated please use the getConfiguration(String, SourceResolver, boolean) + * version of this method instead. + */ + protected Configuration getConfiguration(String descriptor, boolean reloadable) throws ConfigurationException { + return this.getConfiguration( discriptor, null, reloadable ); + } + + /** * Set up the complementary configuration file. Please note that * multiple Actions can share the same configurations. By using * this approach, we can limit the number of config files. @@ -70,22 +78,22 @@ try { sourceHandler = (SourceHandler) this.manager.lookup(SourceHandler.ROLE); - if (descriptor.startsWith("file:")) { + if (descriptor.startsWith("file:")) { resource = sourceHandler.getSource((Environment)resolver,((Environment)resolver).getContext(), descriptor.substring(5)); - } else + } else resource = sourceHandler.getSource(null, descriptor); if (conf == null || conf.lastModified < resource.getLastModified()) { getLogger().debug("(Re)Loading " + descriptor); - if (conf == null) + if (conf == null) conf = new ConfigurationHelper(); - + SAXConfigurationHandler builder = new SAXConfigurationHandler(); resource.toSAX(builder); - + conf.lastModified = resource.getLastModified(); conf.configuration = builder.getConfiguration(); - + this.cacheConfiguration(descriptor, conf); } else { getLogger().debug("Using cached configuration for " + descriptor); @@ -97,11 +105,11 @@ if (resource != null) resource.recycle(); if (sourceHandler != null) this.manager.release((Component) sourceHandler); } - } else { - getLogger().debug("Using fixed cached configuration for " + descriptor); - } + } else { + getLogger().debug("Using fixed cached configuration for " + descriptor); } - + } + return conf.configuration; }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]