cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r585825 - in /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon: components/treeprocessor/ components/treeprocessor/sitemap/ core/container/spring/avalon/
Date Thu, 18 Oct 2007 03:34:51 GMT
Author: vgritsenko
Date: Wed Oct 17 20:34:50 2007
New Revision: 585825

URL: http://svn.apache.org/viewvc?rev=585825&view=rev
Log:
starting work on converting sitemap / treeprocessor

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessorSitemapErrorHandler.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonChildLoggerFactoryBean.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/BridgeElementParser.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessorSitemapErrorHandler.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessorSitemapErrorHandler.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessorSitemapErrorHandler.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/TreeProcessorSitemapErrorHandler.java
Wed Oct 17 20:34:50 2007
@@ -18,7 +18,6 @@
 
 import org.apache.cocoon.Processor;
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
-import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.sitemap.SitemapErrorHandler;
@@ -54,8 +53,8 @@
      * Construct error handler with everything needed to handle an error.
      */
     public TreeProcessorSitemapErrorHandler(ErrorHandlerHelper handler,
-                               Environment environment,
-                               InvokeContext context) {
+                                            Environment environment,
+                                            InvokeContext context) {
         this.handler = handler;
         this.environment = environment;
         this.context = context;

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
Wed Oct 17 20:34:50 2007
@@ -16,7 +16,9 @@
  */
 package org.apache.cocoon.components.treeprocessor.sitemap;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import java.io.IOException;
+import java.util.Map;
+
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
@@ -29,11 +31,10 @@
 import org.apache.cocoon.components.notification.NotifyingBuilder;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ProcessingNode;
+import org.apache.cocoon.core.container.spring.avalon.AvalonUtils;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.ObjectModelHelper;
-
-import java.io.IOException;
-import java.util.Map;
+import org.apache.cocoon.util.AbstractLogEnabled;
 
 /**
  * Helps to call error handlers from PipelineNode and PipelinesNode.
@@ -61,16 +62,13 @@
      */
     private HandleErrorsNode error500;
 
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        this.handledErrorsLogger = logger.getChildLogger("handled-errors");
-    }
 
     /**
      * The component manager is used to create notifying builders.
      */
-    public void service(ServiceManager manager) {
+    public void service(ServiceManager manager) throws ServiceException {
         this.manager = manager;
+        this.handledErrorsLogger = ((Logger) this.manager.lookup(AvalonUtils.LOGGER_ROLE)).getChildLogger("handled");
     }
 
     void set404Handler(ProcessingNode node) {
@@ -104,11 +102,12 @@
                                       InvokeContext context)
     throws Exception {
         final Processor.InternalPipelineDescription desc = prepareErrorHandler(ex, env, context);
-        if ( desc != null ) {
+        if (desc != null) {
             desc.release();
             return true;
         }
-        return  false;
+
+        return false;
     }
 
     /**
@@ -151,11 +150,12 @@
                                       InvokeContext context)
     throws Exception {
         final Processor.InternalPipelineDescription desc = prepareErrorHandler(node, ex,
env, context);
-        if ( desc != null ) {
+        if (desc != null) {
             desc.release();
             return true;
         }
-        return  false;
+
+        return false;
     }
 
     /**

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Wed Oct 17 20:34:50 2007
@@ -18,10 +18,10 @@
 
 import java.util.Map;
 
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
+
 import org.apache.cocoon.ConnectionResetException;
 import org.apache.cocoon.ResourceNotFoundException;
 import org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode;
@@ -74,11 +74,6 @@
      */
     public void service(ServiceManager manager) {
         this.errorHandlerHelper.service(manager);
-    }
-
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        this.errorHandlerHelper.enableLogging(logger);
     }
 
     public void setChildren(ProcessingNode[] nodes) {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
Wed Oct 17 20:34:50 2007
@@ -17,7 +17,6 @@
 package org.apache.cocoon.components.treeprocessor.sitemap;
 
 import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 
@@ -55,11 +54,6 @@
     public void service(ServiceManager manager) {
         this.manager = manager;
         this.errorHandlerHelper.service(manager);
-    }
-
-    public void enableLogging(Logger logger) {
-        super.enableLogging(logger);
-        this.errorHandlerHelper.enableLogging(logger);
     }
 
     public void setErrorHandler(ProcessingNode node) {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonBeanPostProcessor.java
Wed Oct 17 20:34:50 2007
@@ -51,9 +51,8 @@
  * This is a Spring BeanPostProcessor adding support for the Avalon lifecycle
  * interfaces.
  * 
- * @version $Id: AvalonBeanPostProcessor.java 470890 2006-11-03 16:41:24Z
- *          lgawron $
  * @since 2.2
+ * @version $Id$
  */
 public class AvalonBeanPostProcessor implements DestructionAwareBeanPostProcessor, BeanFactoryAware
{
 
@@ -63,11 +62,13 @@
     protected Context context;
     protected BeanFactory beanFactory;
     protected ConfigurationInfo configurationInfo;
+
     protected Settings settings = new MutableSettings("test");
     protected ResourceLoader resourceLoader = new DefaultResourceLoader();
 
     protected String location = "classpath*:META-INF/cocoon/avalon";
 
+
     public void setSettings(Settings settings) {
         this.settings = settings;
     }
@@ -110,7 +111,7 @@
         }
         final Properties mergedProps = new Properties();
         final ServletContextResourcePatternResolver resolver = new ServletContextResourcePatternResolver(resourceLoader);
-        final Resource dirResource = resourceLoader.getResource(this.location);
+        // final Resource dirResource = resourceLoader.getResource(this.location);
 
         try {
             Resource[] resources = resolver.getResources(this.location + "/*.properties");
@@ -204,8 +205,7 @@
     }
 
     /**
-     * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(java.lang.Object,
-     *      java.lang.String)
+     * @see org.springframework.beans.factory.config.BeanPostProcessor#postProcessBeforeInitialization(Object,
String)
      */
     public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
{
         final ComponentInfo info = (ComponentInfo) this.configurationInfo.getComponents().get(beanName);
@@ -215,6 +215,7 @@
                 // lifecycle interfaces
                 return bean;
             }
+
             if (info.getLoggerCategory() != null) {
                 ContainerUtil.enableLogging(bean, this.logger.getChildLogger(info.getLoggerCategory()));
             } else {
@@ -245,6 +246,7 @@
         } catch (Exception e) {
             throw new BeanCreationException("Unable to initialize Avalon component with role
" + beanName, e);
         }
+
         return bean;
     }
 

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonChildLoggerFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonChildLoggerFactoryBean.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonChildLoggerFactoryBean.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonChildLoggerFactoryBean.java
Wed Oct 17 20:34:50 2007
@@ -31,8 +31,7 @@
  * @since 2.2
  * @version $Id$
  */
-public class AvalonChildLoggerFactoryBean
-    implements FactoryBean, BeanFactoryAware {
+public class AvalonChildLoggerFactoryBean implements FactoryBean, BeanFactoryAware {
 
     /** Logger (we use the same logging mechanism as Spring!) */
     protected final Log log = LogFactory.getLog(getClass());
@@ -45,19 +44,23 @@
     /** The logging category. */
     protected String category;
 
+    
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
     /**
-     * @see org.springframework.beans.factory.BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
+     * @see BeanFactoryAware#setBeanFactory(org.springframework.beans.factory.BeanFactory)
      */
     public void setBeanFactory(BeanFactory factory) throws BeansException {
         this.beanFactory = factory;
     }
 
-    protected void init()
-    throws Exception {
+    protected void init() throws Exception {
         // get parent factory
-        final BeanFactory parentFactory = ((HierarchicalBeanFactory)this.beanFactory).getParentBeanFactory();
-        final Logger parentLogger = (Logger)parentFactory.getBean(AvalonUtils.LOGGER_ROLE);
-        if ( this.category == null ) {
+        final BeanFactory parentFactory = ((HierarchicalBeanFactory) this.beanFactory).getParentBeanFactory();
+        final Logger parentLogger = (Logger) parentFactory.getBean(AvalonUtils.LOGGER_ROLE);
+        if (this.category == null) {
             this.logger = parentLogger;
         } else {
             this.logger = parentLogger.getChildLogger(this.category);
@@ -83,9 +86,5 @@
      */
     public boolean isSingleton() {
         return true;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
     }
 }

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonLoggerFactoryBean.java
Wed Oct 17 20:34:50 2007
@@ -27,12 +27,16 @@
  * @since 2.2
  * @version $Id$
  */
-public class AvalonLoggerFactoryBean
-    implements FactoryBean {
+public class AvalonLoggerFactoryBean implements FactoryBean {
 
     /** The logging category. */
     protected String category = "cocoon";
 
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
     /**
      * @see org.springframework.beans.factory.FactoryBean#getObject()
      */
@@ -52,9 +56,5 @@
      */
     public boolean isSingleton() {
         return true;
-    }
-
-    public void setCategory(String category) {
-        this.category = category;
     }
 }

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/AvalonUtils.java
Wed Oct 17 20:34:50 2007
@@ -25,8 +25,8 @@
 /**
  * Some utility methods for handling Avalon stuff.
  *
- * @version $Id$
  * @since 2.2
+ * @version $Id$
  */
 public class AvalonUtils {
 
@@ -44,9 +44,10 @@
      */
     public static Configuration replaceProperties(Configuration tree, Settings settings)
     throws ConfigurationException {
-        if ( tree == null || settings == null ) {
+        if (tree == null || settings == null) {
             return tree;
         }
+
         // first clone the tree
         final DefaultConfiguration root = new DefaultConfiguration(tree, true);
         // now replace properties
@@ -63,17 +64,19 @@
     protected static void _replaceProperties(DefaultConfiguration config, Settings settings)
     throws ConfigurationException {
         final String[] names = config.getAttributeNames();
-        for(int i=0; i<names.length; i++) {
+        for (int i = 0; i < names.length; i++) {
             final String value = config.getAttribute(names[i]);
             config.setAttribute(names[i], PropertyHelper.replace(value, settings));
         }
+
         final String value = config.getValue(null);
-        if ( value != null ) {
+        if (value != null) {
             config.setValue(PropertyHelper.replace(value, settings));
         }
+
         final Configuration[] children = config.getChildren();
-        for(int m=0; m<children.length; m++) {
-            _replaceProperties((DefaultConfiguration)children[m], settings);
+        for (int m = 0; m < children.length; m++) {
+            _replaceProperties((DefaultConfiguration) children[m], settings);
         }
     }
 

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/BridgeElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/BridgeElementParser.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/BridgeElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/BridgeElementParser.java
Wed Oct 17 20:34:50 2007
@@ -56,31 +56,35 @@
  * bean, reads the Avalon style configurations and registers the components
  * as beans in the Spring bean definition registry.
  *
- * @version $Id$
  * @since 2.2
+ * @version $Id$
  */
 public class BridgeElementParser extends AbstractElementParser {
+
     public static final String DEFAULT_COCOON_XCONF_LOCATION = "resource://org/apache/cocoon/cocoon.xconf";
-    
+
+
     /**
-     * @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(org.w3c.dom.Element,
org.springframework.beans.factory.xml.ParserContext)
+     * @see org.springframework.beans.factory.xml.BeanDefinitionParser#parse(Element, ParserContext)
      */
     public BeanDefinition parse(Element element, ParserContext parserContext) {
         final ResourceLoader resourceLoader = parserContext.getReaderContext().getReader().getResourceLoader();
+
         // read avalon style configuration - it's optional for this element.
         // the schema for the sitemap element ensures that location is never null.
-        final String location = this.getAttributeValue(element, "location", DEFAULT_COCOON_XCONF_LOCATION);
+        final String location = getAttributeValue(element, "location", DEFAULT_COCOON_XCONF_LOCATION);
         try {
-            final ConfigurationInfo info = this.readConfiguration(location, resourceLoader);
+            final ConfigurationInfo info = readConfiguration(location, resourceLoader);
 
-            this.createComponents(element,
-                                  info,
-                                  parserContext.getRegistry(),
-                                  parserContext.getDelegate().getReaderContext().getReader(),
-                                  resourceLoader);
+            createComponents(element,
+                             info,
+                             parserContext.getRegistry(),
+                             parserContext.getDelegate().getReaderContext().getReader(),
+                             resourceLoader);
         } catch (Exception e) {
             throw new BeanDefinitionStoreException("Unable to read Avalon configuration from
'" + location + "'.",e);
         }
+
         return null;
     }
 
@@ -98,17 +102,17 @@
                                  ResourceLoader         resourceLoader)
     throws Exception {
         // add context
-        this.addContext(element, registry);
+        addContext(element, registry);
 
         // add service manager
-        this.addComponent(AvalonServiceManager.class,
-                AvalonUtils.SERVICE_MANAGER_ROLE,
-                null,
-                false,
-                registry);
+        addComponent(AvalonServiceManager.class,
+                     AvalonUtils.SERVICE_MANAGER_ROLE,
+                     null,
+                     false,
+                     registry);
 
         // add logger
-        this.addLogger(registry, info.getRootLogger());
+        addLogger(registry, info.getRootLogger());
 
         // handle includes of spring configurations
         final Iterator includeIter = info.getImports().iterator();
@@ -152,16 +156,18 @@
 
     /**
      * Add the logger bean.
+     *
      * @param registry       The bean registry.
      * @param loggerCategory The optional category for the logger.
      */
     protected void addLogger(BeanDefinitionRegistry registry,
                              String                 loggerCategory) {
-        final RootBeanDefinition beanDef = this.createBeanDefinition(AvalonLoggerFactoryBean.class,
null, false);
-        if ( loggerCategory != null ) {
+        final RootBeanDefinition beanDef = createBeanDefinition(AvalonLoggerFactoryBean.class,
null, false);
+        if (loggerCategory != null) {
             beanDef.getPropertyValues().addPropertyValue("category", loggerCategory);
         }
-        this.register(beanDef, AvalonUtils.LOGGER_ROLE, registry);
+
+        register(beanDef, AvalonUtils.LOGGER_ROLE, registry);
     }
 
     public void createConfig(ConfigurationInfo      info,

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ComponentInfo.java
Wed Oct 17 20:34:50 2007
@@ -289,11 +289,8 @@
      * Is this a selector?
      */
     public boolean isSelector() {
-        if ( this.componentClassName.equals("org.apache.cocoon.core.container.DefaultServiceSelector")
-             || this.componentClassName.equals("org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector")
) {
-            return true;
-        }
-        return false;
+        return this.componentClassName.equals("org.apache.cocoon.core.container.DefaultServiceSelector")
||
+               this.componentClassName.equals("org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector");
     }
 
     public String getDefaultValue() {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationInfo.java
Wed Oct 17 20:34:50 2007
@@ -22,7 +22,6 @@
 import java.util.List;
 import java.util.Map;
 
-
 /**
  * This bean stores information about a complete Avalon style configuration.
  * It can be passed to an {@link XmlConfigCreator} to create a Spring like
@@ -132,8 +131,8 @@
     }
 
     public String getRoleForName(String alias) {
-        final String value = (String)this.shorthands.get(alias);
-        if ( value != null ) {
+        final String value = (String) this.shorthands.get(alias);
+        if (value != null) {
             return value;
         }
         return alias;

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/ConfigurationReader.java
Wed Oct 17 20:34:50 2007
@@ -195,7 +195,7 @@
 
     protected void convert(String relativePath)
     throws Exception {
-        if ( this.logger.isDebugEnabled() ) {
+        if (this.logger.isDebugEnabled()) {
             this.logger.debug("Reading Avalon configuration from " + relativePath);
         }
         Resource root = this.resolver.getResource(this.getUrl(relativePath, null));
@@ -204,9 +204,10 @@
         final Configuration config = b.build(this.getInputSource(root));
         // validate cocoon.xconf
         if (!"cocoon".equals(config.getName())) {
-            throw new ConfigurationException("Invalid configuration file\n"
-                    + config.toString());
+            throw new ConfigurationException("Invalid configuration file\n" +
+                                             config.toString());
         }
+
         if (this.logger.isDebugEnabled()) {
             this.logger.debug("Configuration version: " + config.getAttribute("version"));
         }
@@ -215,6 +216,7 @@
                     "Invalid configuration schema version. Must be '"
                             + Constants.CONF_VERSION + "'.");
         }
+
         this.convert(config, null, this.getUrl(root));
     }
 
@@ -243,9 +245,10 @@
 
     protected void convert(Configuration config, Configuration additionalConfig, String rootUri)
     throws Exception {
-        if ( this.logger.isDebugEnabled() ) {
+        if (this.logger.isDebugEnabled() ) {
             this.logger.debug("Converting Avalon configuration from configuration object:
" + config);
         }
+
         // It's possible to define a logger on a per sitemap/service manager base.
         // This is the default logger for all components defined with this sitemap/manager.
         this.configInfo.setRootLogger(config.getAttribute("logger", null));

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java?rev=585825&r1=585824&r2=585825&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/avalon/SitemapElementParser.java
Wed Oct 17 20:34:50 2007
@@ -27,13 +27,14 @@
 import org.w3c.dom.Element;
 
 /**
- * @version $Id$
+ *
  * @since 2.2
+ * @version $Id$
  */
 public class SitemapElementParser extends BridgeElementParser {
 
     /**
-     * @see org.apache.cocoon.core.container.spring.avalon.BridgeElementParser#addContext(org.w3c.dom.Element,
org.springframework.beans.factory.support.BeanDefinitionRegistry)
+     * @see BridgeElementParser#addContext(Element, BeanDefinitionRegistry)
      */
     protected void addContext(Element element, BeanDefinitionRegistry registry) {
         // we get the uriPrefix from the configuration
@@ -53,7 +54,7 @@
     protected void addLogger(BeanDefinitionRegistry registry,
                              String                 loggerCategory) {
         final RootBeanDefinition beanDef = this.createBeanDefinition(AvalonChildLoggerFactoryBean.class,
"init", false);
-        if ( loggerCategory != null ) {
+        if (loggerCategory != null) {
             beanDef.getPropertyValues().addPropertyValue("category", loggerCategory);
         }
         this.register(beanDef, AvalonUtils.LOGGER_ROLE, registry);



Mime
View raw message