cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r124200 - in cocoon/trunk/src: blocks/python/java/org/apache/cocoon/components/language/programming/python blocks/xsp/java/org/apache/cocoon/acting blocks/xsp/java/org/apache/cocoon/components/language/programming/java blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript core/java/org/apache/cocoon/core/container
Date Wed, 05 Jan 2005 13:56:26 GMT
Author: cziegeler
Date: Wed Jan  5 05:56:23 2005
New Revision: 124200

URL: http://svn.apache.org/viewcvs?view=rev&rev=124200
Log:
Reduce number of parameters
Modified:
   cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
   cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java
   cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
   cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
   cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java
   cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java

Modified: cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java?view=diff&rev=124200&p1=cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java&r1=124199&p2=cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java&r2=124200
==============================================================================
--- cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
(original)
+++ cocoon/trunk/src/blocks/python/java/org/apache/cocoon/components/language/programming/python/PythonProgram.java
Wed Jan  5 05:56:23 2005
@@ -24,6 +24,7 @@
 import org.apache.cocoon.components.language.programming.Program;
 import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.core.container.AbstractComponentHandler;
+import org.apache.cocoon.core.container.ComponentEnvironment;
 import org.apache.cocoon.core.container.ComponentHandler;
 
 import java.io.File;
@@ -65,9 +66,13 @@
     public ComponentHandler getHandler(ServiceManager manager,
                                        Context context)
     throws Exception {
+        final ComponentEnvironment env = new ComponentEnvironment();
+        env.serviceManager = manager;
+        env.context = context;
+        env.logger = this.getLogger();
 
         return AbstractComponentHandler.getComponentHandler(
-                null, clazz, config, manager, context, getLogger(), null, null);
+                null, clazz, config, env, null);
     }
 
     public CompiledComponent newInstance() throws Exception {

Modified: cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java?view=diff&rev=124200&p1=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java&r1=124199&p2=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java&r2=124200
==============================================================================
--- cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java	(original)
+++ cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/acting/ServerPagesAction.java	Wed Jan
 5 05:56:23 2005
@@ -28,6 +28,7 @@
 import org.apache.cocoon.components.sax.XMLByteStreamCompiler;
 import org.apache.cocoon.components.sax.XMLByteStreamFragment;
 import org.apache.cocoon.core.container.AbstractComponentHandler;
+import org.apache.cocoon.core.container.ComponentEnvironment;
 import org.apache.cocoon.core.container.ComponentHandler;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Redirector;
@@ -88,14 +89,14 @@
     public void configure(Configuration conf)
     throws ConfigurationException {
         try {
+            final ComponentEnvironment env = new ComponentEnvironment();
+            env.serviceManager = this.manager;
+            env.logger = this.getLogger();
             this.generatorHandler = AbstractComponentHandler.getComponentHandler(
                 null,  // role
                 ServerPagesGenerator.class,
                 conf,
-                this.manager,
-                null,  // Context
-                this.getLogger(),
-                null,  // LoggerManager
+                env,
                 null   // RoleManager
             );
 

Modified: cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java?view=diff&rev=124200&p1=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java&r1=124199&p2=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java&r2=124200
==============================================================================
--- cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
(original)
+++ cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/java/JavaProgram.java
Wed Jan  5 05:56:23 2005
@@ -23,6 +23,7 @@
 import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.components.language.programming.Program;
 import org.apache.cocoon.core.container.AbstractComponentHandler;
+import org.apache.cocoon.core.container.ComponentEnvironment;
 import org.apache.cocoon.core.container.ComponentHandler;
 
 /**
@@ -47,12 +48,16 @@
     public ComponentHandler getHandler(ServiceManager manager,
                                        Context context)
     throws Exception {
+        final ComponentEnvironment env = new ComponentEnvironment();
+        env.serviceManager = manager;
+        env.context = context;
+        env.logger = this.getLogger();
 
         return AbstractComponentHandler.getComponentHandler(
                 null, // role
                 program,
                 new DefaultConfiguration("", "GeneratorSelector"),
-                manager, context, getLogger(), null, null);
+                env, null);
     }
 
     public CompiledComponent newInstance() throws Exception {

Modified: cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java?view=diff&rev=124200&p1=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java&r1=124199&p2=cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java&r2=124200
==============================================================================
--- cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
(original)
+++ cocoon/trunk/src/blocks/xsp/java/org/apache/cocoon/components/language/programming/javascript/JavascriptProgram.java
Wed Jan  5 05:56:23 2005
@@ -24,6 +24,7 @@
 import org.apache.cocoon.components.language.generator.CompiledComponent;
 import org.apache.cocoon.components.language.programming.Program;
 import org.apache.cocoon.core.container.AbstractComponentHandler;
+import org.apache.cocoon.core.container.ComponentEnvironment;
 import org.apache.cocoon.core.container.ComponentHandler;
 
 import java.io.File;
@@ -67,9 +68,13 @@
     public ComponentHandler getHandler(ServiceManager manager,
                                        Context context)
     throws Exception {
+        final ComponentEnvironment env = new ComponentEnvironment();
+        env.serviceManager = manager;
+        env.context = context;
+        env.logger = this.getLogger();
 
         return AbstractComponentHandler.getComponentHandler(
-                null, clazz, config, manager, context, getLogger(), null, null);
+                null, clazz, config, env, null);
     }
 
     public CompiledComponent newInstance() throws Exception {

Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java?view=diff&rev=124200&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java&r1=124199&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java&r2=124200
==============================================================================
--- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java
(original)
+++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractComponentHandler.java
Wed Jan  5 05:56:23 2005
@@ -16,14 +16,10 @@
  */
 package org.apache.cocoon.core.container;
 
-import org.apache.avalon.excalibur.logger.LoggerManager;
 import org.apache.avalon.excalibur.pool.Poolable;
 import org.apache.avalon.framework.component.Composable;
 import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.thread.SingleThreaded;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.ServiceInfo;
@@ -67,10 +63,7 @@
     public static ComponentHandler getComponentHandler( final String role,
                                                         final Class componentClass,
                                                         final Configuration configuration,
-                                                        final ServiceManager serviceManager,
-                                                        final Context context,
-                                                        final Logger logger,
-                                                        final LoggerManager loggerManager,
+                                                        final ComponentEnvironment env,
                                                         final RoleManager roleManager)
     throws Exception {
         int numInterfaces = 0;
@@ -116,12 +109,6 @@
         // Create the factory to use to create the instances of the Component.
         ComponentFactory factory;
         
-        final ComponentEnvironment env = new ComponentEnvironment();
-        env.serviceManager = serviceManager;
-        env.context = context;
-        env.logger = logger;
-        env.loggerManager = loggerManager;
-
         if (DefaultServiceSelector.class.isAssignableFrom(componentClass)) {
             // Special factory for DefaultServiceSelector
             factory = new DefaultServiceSelector.Factory(env, roleManager, info, role);
@@ -137,12 +124,12 @@
         ComponentHandler handler;
         
         if( info.getModel() == ServiceInfo.MODEL_POOLED )  {
-            handler = new PoolableComponentHandler( info, logger, factory, configuration
);
+            handler = new PoolableComponentHandler( info, env.logger, factory, configuration
);
         } else if( info.getModel() == ServiceInfo.MODEL_SINGLETON ) {
-            handler = new ThreadSafeComponentHandler( info, logger, factory );
+            handler = new ThreadSafeComponentHandler( info, env.logger, factory );
         } else {
             // This is a SingleThreaded component
-            handler = new SingleThreadedComponentHandler( info, logger, factory );
+            handler = new SingleThreadedComponentHandler( info, env.logger, factory );
         }
 
         return handler;

Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java?view=diff&rev=124200&p1=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java&r1=124199&p2=cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java&r2=124200
==============================================================================
--- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
(original)
+++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/AbstractServiceManager.java
Wed Jan  5 05:56:23 2005
@@ -97,13 +97,15 @@
                                                     final Configuration configuration,
                                                     final ServiceManager serviceManager)
     throws Exception {
+        final ComponentEnvironment env = new ComponentEnvironment();
+        env.serviceManager = serviceManager;
+        env.context = context;
+        env.logger = this.getLogger();
+        env.loggerManager = this.loggerManager;
         return AbstractComponentHandler.getComponentHandler(role,
                                                      componentClass,
                                                      configuration,
-                                                     serviceManager,
-                                                     this.context,
-                                                     this.getLogger(),
-                                                     this.loggerManager,
+                                                     env,
                                                      this.roleManager);
     }
 

Mime
View raw message