You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/18 05:37:23 UTC

svn commit: r585829 - in /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components: repository/RepositoryManager.java source/impl/SourceDescriptorManager.java

Author: vgritsenko
Date: Wed Oct 17 20:37:22 2007
New Revision: 585829

URL: http://svn.apache.org/viewvc?rev=585829&view=rev
Log:
cleanup

Modified:
    cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/repository/RepositoryManager.java
    cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/SourceDescriptorManager.java

Modified: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/repository/RepositoryManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/repository/RepositoryManager.java?rev=585829&r1=585828&r2=585829&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/repository/RepositoryManager.java (original)
+++ cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/repository/RepositoryManager.java Wed Oct 17 20:37:22 2007
@@ -37,6 +37,8 @@
 
 /**
  * A factory component to create instances of repositories.
+ *
+ * @version $Id$
  */
 public class RepositoryManager extends AbstractLogEnabled
                                implements Serviceable, Disposable, Configurable, ThreadSafe {
@@ -97,14 +99,13 @@
         }
 
         String className = null;
-
         try {
-            Configuration repoConfiguration = (Configuration)this.repos.get(hint);
+            Configuration repoConfiguration = (Configuration) this.repos.get(hint);
             className = repoConfiguration.getAttribute("class");
             Class repoClass = Class.forName(className);
-    
-            if (this.getLogger().isDebugEnabled()) {
-                this.getLogger().debug("loading class" + className);
+
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("Loading class" + className);
             }
 
             Repository repo = (Repository) repoClass.newInstance();
@@ -130,5 +131,4 @@
             throw new ProcessingException("Could not setup component " + className, e);
         }
     }
-    
-}
\ No newline at end of file
+}

Modified: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/SourceDescriptorManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/SourceDescriptorManager.java?rev=585829&r1=585828&r2=585829&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/SourceDescriptorManager.java (original)
+++ cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/SourceDescriptorManager.java Wed Oct 17 20:37:22 2007
@@ -30,6 +30,7 @@
 import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.context.Contextualizable;
+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;
@@ -83,24 +84,26 @@
         m_inspectors = new HashSet();
         final ClassLoader classloader = Thread.currentThread().getContextClassLoader();
         final Configuration[] children = m_configuration.getChildren();
-        
+
+        // Avalon logger for legacy components
+        Logger logger = new CLLoggerWrapper(getLogger());
+
         for (int i = 0; i < children.length; i++) {
-            String className = children[i].getAttribute("class","");
+            String className = children[i].getAttribute("class", "");
+
             SourceInspector inspector;
             try {
                 final Class inspectorClass = classloader.loadClass(className);
                 inspector = (SourceInspector) inspectorClass.newInstance();
             } catch (InstantiationException ie) {
-                throw new ConfigurationException(
-                    "Could not instantiate class "+className, ie);
+                throw new ConfigurationException("Could not instantiate class " + className, ie);
             } catch (ClassNotFoundException cnfe) {
-                throw new ConfigurationException(
-                    "Could not load class "+className, cnfe);
+                throw new ConfigurationException("Could not load class " + className, cnfe);
             } catch (IllegalAccessException iae) {
-                 throw new ConfigurationException(
-                    "Could not load class "+className, iae);
+                throw new ConfigurationException("Could not load class " + className, iae);
             }
-            ContainerUtil.enableLogging(inspector, new CLLoggerWrapper(getLogger()));
+            
+            ContainerUtil.enableLogging(inspector, logger);
             ContainerUtil.contextualize(inspector, m_context);
             ContainerUtil.service(inspector, m_manager);
             ContainerUtil.configure(inspector, children[i]);