cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r511771 - in /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src: changes/ main/java/org/apache/cocoon/spring/configurator/impl/
Date Mon, 26 Feb 2007 10:26:50 GMT
Author: cziegeler
Date: Mon Feb 26 02:26:49 2007
New Revision: 511771

URL: http://svn.apache.org/viewvc?view=rev&rev=511771
Log:
SettingsBeanFactoryPostProcessor can be used outside a servlet context

Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml?view=diff&rev=511771&r1=511770&r2=511771
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/changes/changes.xml
Mon Feb 26 02:26:49 2007
@@ -25,6 +25,9 @@
     <document>
       <body>
         <release version="1.0.1" date="2007-00-00" description="unreleased">
+          <action dev="cziegeler" type="fix">
+            SettingsBeanFactoryPostProcessor can be used outside a servlet context.
+          </action>
           <action dev="reinhard" type="fix">
             WebAppContextUtils stored a Spring parent application context in a static field.
This
             made it impossible to reload the context. The static field was removed and a
request

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java?view=diff&rev=511771&r1=511770&r2=511771
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/AbstractSettingsBeanFactoryPostProcessor.java
Mon Feb 26 02:26:49 2007
@@ -41,6 +41,7 @@
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
 import org.springframework.context.ResourceLoaderAware;
+import org.springframework.core.io.FileSystemResourceLoader;
 import org.springframework.core.io.ResourceLoader;
 import org.springframework.web.context.ServletContextAware;
 import org.springframework.web.context.support.ServletContextResourceLoader;
@@ -251,7 +252,11 @@
         if ( this.resourceLoader != null ) {
             return this.resourceLoader;
         }
-        return new ServletContextResourceLoader(this.servletContext);
+        if ( this.servletContext != null ) {
+            return new ServletContextResourceLoader(this.servletContext);
+        } else {
+            return new FileSystemResourceLoader();
+        }
     }
 
     protected String getSystemProperty(String key) {

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java?view=diff&rev=511771&r1=511770&r2=511771
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/SettingsBeanFactoryPostProcessor.java
Mon Feb 26 02:26:49 2007
@@ -134,9 +134,15 @@
         } else {
             version = null;
         }
-        this.servletContext.log("Apache Cocoon Spring Configurator " +
-                                (version != null ? "v" + version + " " : "") +
-                                "is running in mode '" + mode + "'.");
+        // give a startup message
+        final String msg = "Apache Cocoon Spring Configurator " +
+                           (version != null ? "v" + version + " " : "") +
+                           "is running in mode '" + mode + "'.";
+        if ( this.servletContext != null ) {
+            this.servletContext.log(msg);
+        } else {
+            this.logger.info(msg);
+        }
 
         // first we dump the system properties
         this.dumpSystemProperties();
@@ -175,7 +181,7 @@
         }
 
         // fill from the servlet context
-        if ( s.getWorkDirectory() == null ) {
+        if ( this.servletContext != null && s.getWorkDirectory() == null ) {
             final File workDir = (File)this.servletContext.getAttribute("javax.servlet.context.tempdir");
             s.setWorkDirectory(workDir.getAbsolutePath());
         }



Mime
View raw message