bloritsch 01/06/08 11:07:40
Modified: src/org/apache/cocoon Tag: cocoon_20_branch Cocoon.java
src/org/apache/cocoon/sitemap Tag: cocoon_20_branch
AbstractSitemap.java
Log:
Fix Configuration propogation for SitemapComponentManagers.
Revision Changes Path
No revision
No revision
1.9.2.4 +3 -3 xml-cocoon2/src/org/apache/cocoon/Cocoon.java
Index: Cocoon.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/Cocoon.java,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -u -r1.9.2.3 -r1.9.2.4
--- Cocoon.java 2001/06/08 15:38:23 1.9.2.3
+++ Cocoon.java 2001/06/08 18:07:34 1.9.2.4
@@ -55,7 +55,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Pierpaolo Fumagalli</a> (Apache
Software Foundation, Exoffice Technologies)
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
- * @version CVS $Revision: 1.9.2.3 $ $Date: 2001/06/08 15:38:23 $
+ * @version CVS $Revision: 1.9.2.4 $ $Date: 2001/06/08 18:07:34 $
*/
public class Cocoon extends AbstractLoggable implements ThreadSafe, Component,
Initializable, Disposable, Modifiable, Processor, Contextualizable {
/** The application context */
@@ -223,8 +223,6 @@
sitemapRoleManager.setLogger(getLogger());
sitemapRoleManager.configure(sitemapConfig);
- AbstractSitemap.setRoleManager(sitemapRoleManager, sitemapConfig);
-
try {
p = (Parser)startupManager.lookup(Roles.PARSER);
SAXConfigurationHandler b = new SAXConfigurationHandler();
@@ -240,6 +238,8 @@
}
Configuration conf = this.configuration;
+
+ AbstractSitemap.setRoleManager(sitemapRoleManager, conf);
getLogger().debug("Root configuration: " + conf.getName());
if (! "cocoon".equals(conf.getName())) {
No revision
No revision
1.4.2.6 +15 -21 xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java
Index: AbstractSitemap.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/sitemap/AbstractSitemap.java,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -u -r1.4.2.5 -r1.4.2.6
--- AbstractSitemap.java 2001/06/08 17:53:31 1.4.2.5
+++ AbstractSitemap.java 2001/06/08 18:07:37 1.4.2.6
@@ -43,7 +43,7 @@
* Base class for generated <code>Sitemap</code> classes
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.4.2.5 $ $Date: 2001/06/08 17:53:31 $
+ * @version CVS $Revision: 1.4.2.6 $ $Date: 2001/06/08 18:07:37 $
*/
public abstract class AbstractSitemap extends AbstractLoggable implements Sitemap,
Disposable, ThreadSafe {
private Context context;
@@ -91,6 +91,7 @@
this.manager.setRoleManager(AbstractSitemap.roleManager);
try {
+ this.manager.configure(AbstractSitemap.defaultConfig);
this.urlFactory = (URLFactory)manager.lookup(Roles.URL_FACTORY);
// Create Sitemap Selectors
@@ -103,21 +104,19 @@
this.selectors = new SitemapComponentSelector();
// Set Parent Sitemap Selectors
- if (AbstractSitemap.defaultConfig == null) {
- try {
- this.generators.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.GENERATORS));
- this.transformers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.TRANSFORMERS));
- this.serializers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.SERIALIZERS));
- this.readers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.READERS));
- this.actions.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.ACTIONS));
- this.matchers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.MATCHERS));
- this.selectors.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.SELECTORS));
- } catch (ComponentException ce) {
- /* we are ignoring those exceptions. We just want
- * to ensure that the selectors get initialized
- * properly
- */
- }
+ try {
+ this.generators.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.GENERATORS));
+ this.transformers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.TRANSFORMERS));
+ this.serializers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.SERIALIZERS));
+ this.readers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.READERS));
+ this.actions.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.ACTIONS));
+ this.matchers.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.MATCHERS));
+ this.selectors.setParentSelector((SitemapComponentSelector)
this.manager.lookup(Roles.SELECTORS));
+ } catch (ComponentException ce) {
+ /* we are ignoring those exceptions. We just want
+ * to ensure that the selectors get initialized
+ * properly
+ */
}
// Setup the Selectors
@@ -137,11 +136,6 @@
this.manager.addComponentInstance(Roles.ACTIONS, this.actions);
this.manager.addComponentInstance(Roles.MATCHERS, this.matchers);
this.manager.addComponentInstance(Roles.SELECTORS, this.selectors);
-
- if (AbstractSitemap.defaultConfig != null) {
- this.manager.configure(AbstractSitemap.defaultConfig);
- AbstractSitemap.defaultConfig = null;
- }
} catch (Exception e) {
getLogger().error("cannot obtain the Component", e);
throw new ComponentException("cannot obtain the URLFactory", e);
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]