cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r377381 - /cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java
Date Mon, 13 Feb 2006 14:03:33 GMT
Author: cziegeler
Date: Mon Feb 13 06:03:31 2006
New Revision: 377381

URL: http://svn.apache.org/viewcvs?rev=377381&view=rev
Log:
Move init code into own method

Modified:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java?rev=377381&r1=377380&r2=377381&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/Cocoon.java Mon Feb 13 06:03:31
2006
@@ -174,6 +174,19 @@
         this.loggerManager = loggerManager;
     }
 
+    protected void testSpringContainer() throws Exception {
+        System.out.println("Setting up test Spring container...");
+        AvalonEnvironment env = new AvalonEnvironment();
+        env.context = this.context;
+        env.core = this.core;
+        env.logger = this.getLogger();
+        env.servletContext = ((ServletConfig)this.context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG)).getServletContext();
+        env.settings = this.core.getSettings();
+        ApplicationContext rootContext = ApplicationContextFactory.createRootApplicationContext(env);
+        ConfigurationInfo result = ConfigReader.readConfiguration(this.configurationFile.getURI(),
env);
+        ApplicationContext mainContext = ApplicationContextFactory.createApplicationContext(env,
result, rootContext);
+        System.out.println("Getting core cocoon processor context: " + mainContext.getBean(Core.ROLE));
+    }
     /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
@@ -192,18 +205,7 @@
         }
 
         // Test setup spring container
-        System.out.println("Setting up test Spring container");
-        AvalonEnvironment env = new AvalonEnvironment();
-        env.context = this.context;
-        env.core = this.core;
-        env.logger = this.getLogger();
-        env.servletContext = ((ServletConfig)this.context.get(CocoonServlet.CONTEXT_SERVLET_CONFIG)).getServletContext();
-        env.settings = this.core.getSettings();
-        ApplicationContext rootContext = ApplicationContextFactory.createRootApplicationContext(env);
-        ConfigurationInfo result = ConfigReader.readConfiguration(this.configurationFile.getURI(),
env);
-        ApplicationContext mainContext = ApplicationContextFactory.createApplicationContext(env,
result, rootContext);
-        System.out.println("Getting something from mainContext: " + mainContext.getBean(Core.ROLE));
-        // END Test setup
+        this.testSpringContainer();
 
         this.serviceManager = new CocoonServiceManager(this.parentServiceManager);
         ContainerUtil.enableLogging(this.serviceManager, this.rootLogger.getChildLogger("manager"));
@@ -538,7 +540,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.Processor#getEnvironmentHelper()
+     * @see org.apache.cocoon.Processor#getSourceResolver()
      */
     public org.apache.cocoon.environment.SourceResolver getSourceResolver() {
         return this.environmentHelper;



Mime
View raw message