cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r171343 - in /cocoon: blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/ trunk/src/java/org/apache/cocoon/core/ trunk/src/java/org/apache/cocoon/serialization/ trunk/src/java/org/apache/cocoon/servlet/ trunk/src/test/org/apache/cocoon/core/
Date Sun, 22 May 2005 16:59:14 GMT
Author: cziegeler
Date: Sun May 22 09:59:13 2005
New Revision: 171343

URL: http://svn.apache.org/viewcvs?rev=171343&view=rev
Log:
Only expose getter methods of Settings

Added:
    cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java   (with props)
Modified:
    cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
    cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/SettingsHelper.java
    cocoon/trunk/src/java/org/apache/cocoon/core/BootstrapEnvironment.java
    cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java
    cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
    cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java
    cocoon/trunk/src/java/org/apache/cocoon/servlet/SettingsHelper.java
    cocoon/trunk/src/test/org/apache/cocoon/core/TestBootstrapEnvironment.java

Modified: cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
(original)
+++ cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/CocoonPortlet.java
Sun May 22 09:59:13 2005
@@ -54,6 +54,7 @@
 import org.apache.cocoon.components.notification.Notifying;
 import org.apache.cocoon.core.BootstrapEnvironment;
 import org.apache.cocoon.core.CoreUtil;
+import org.apache.cocoon.core.MutableSettings;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.Environment;
@@ -894,7 +895,7 @@
         /**
          * @see org.apache.cocoon.core.BootstrapEnvironment#configure(org.apache.cocoon.configuration.Settings)
          */
-        public void configure(Settings settings) {
+        public void configure(MutableSettings settings) {
             // fill from the portlet parameters
             SettingsHelper.fill(settings, this.config);
             if ( settings.getWorkDirectory() == null ) {

Modified: cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/SettingsHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/SettingsHelper.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/SettingsHelper.java
(original)
+++ cocoon/blocks/supported/portal/trunk/java/org/apache/cocoon/portlet/SettingsHelper.java
Sun May 22 09:59:13 2005
@@ -19,7 +19,7 @@
 
 import javax.portlet.PortletConfig;
 
-import org.apache.cocoon.core.Settings;
+import org.apache.cocoon.core.MutableSettings;
 import org.apache.cocoon.util.StringUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.SystemUtils;
@@ -36,7 +36,7 @@
         //  no instantiation
     }
     
-    public static void fill(Settings s, PortletConfig config) {
+    public static void fill(MutableSettings s, PortletConfig config) {
         String value;
 
         s.setInitClassloader(getInitParameterAsBoolean(config, "init-classloader", s.isInitClassloader()));
@@ -152,7 +152,7 @@
         return Integer.parseInt(value);
     }
     
-    private static void handleLoadClass(String param, Settings s) {
+    private static void handleLoadClass(String param, MutableSettings s) {
         if ( param == null ) {
             return;
         }
@@ -170,7 +170,7 @@
      * separate each entry with whitespace, a comma, or a semi-colon.
      * Cocoon will strip any whitespace from the entry.
      */
-    private static void handleForceProperty(String forceSystemProperty, Settings s) {
+    private static void handleForceProperty(String forceSystemProperty, MutableSettings s)
{
         if (forceSystemProperty != null) {
             StringTokenizer tokenizer = new StringTokenizer(forceSystemProperty, " \t\r\n\f;,",
false);
 
@@ -197,7 +197,7 @@
      * Retreives the "extra-classpath" attribute, that needs to be
      * added to the class path.
      */
-    private static void handleExtraClassPath(String extraClassPath, Settings settings) {
+    private static void handleExtraClassPath(String extraClassPath, MutableSettings settings)
{
         if (extraClassPath != null) {
             StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR,
false);
             while (st.hasMoreTokens()) {

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/BootstrapEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/BootstrapEnvironment.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/BootstrapEnvironment.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/BootstrapEnvironment.java Sun May 22 09:59:13
2005
@@ -59,7 +59,7 @@
 
     InputStream getInputStream(String path);
     
-    void configure(Settings settings);
+    void configure(MutableSettings settings);
     void configureLoggingContext(DefaultContext context);
 
     void configure(DefaultContext context);

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java Sun May 22 09:59:13 2005
@@ -80,7 +80,7 @@
     protected final DefaultContext appContext = new ComponentContext();
 
     /** The settings. */
-    protected Settings settings;
+    protected MutableSettings settings;
 
     /** The parent service manager. */
     protected ServiceManager parentManager;
@@ -327,9 +327,9 @@
      * Get the settings for Cocoon.
      * @return A new Settings object
      */
-    protected Settings createSettings() {
+    protected MutableSettings createSettings() {
         // create an empty settings objects
-        final Settings s = new Settings();
+        final MutableSettings s = new MutableSettings();
 
         String additionalPropertyFile = System.getProperty(Settings.PROPERTY_USER_SETTINGS);
 

Added: cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java?rev=171343&view=auto
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java (added)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java Sun May 22 09:59:13
2005
@@ -0,0 +1,348 @@
+/*
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.core;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.lang.BooleanUtils;
+import org.apache.commons.lang.math.NumberUtils;
+
+/**
+ * This object holds the global configuration of Cocoon.
+ *
+ * @version SVN $Id$
+ */
+public class MutableSettings extends Settings {
+
+    protected boolean readOnly = false;
+
+    /**
+     * Create a new settings object
+     */
+    public MutableSettings() {
+        // nothing to do
+    }
+
+    /**
+     * Fill from a properties object
+     */
+    public void fill(Properties props) {
+        this.checkWriteable();
+        if ( props != null ) {
+            final Iterator i = props.entrySet().iterator();
+            while ( i.hasNext() ) {
+                final Map.Entry current = (Map.Entry)i.next();
+                String key = current.getKey().toString();
+                if ( key.startsWith(KEYPREFIX) ) {
+                    key = key.substring(KEYPREFIX.length());
+                    final String value = current.getValue().toString();
+
+                    if ( key.equals(KEY_INIT_CLASSLOADER) ) {
+                        this.initClassloader = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_CONFIGURATION) ) {
+                        this.configuration = value;
+                    } else if ( key.equals(KEY_CONFIGURATION_RELOAD_DELAY) ) {
+                        this.configurationReloadDelay = NumberUtils.toLong(value);
+                    } else if ( key.equals(KEY_LOGGING_CONFIGURATION) ) {
+                        this.loggingConfiguration = value;
+                    } else if ( key.equals(KEY_LOGGING_ACCESS_LOGGER) ) {
+                        this.accessLogger = value;
+                    } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
+                        this.cocoonLogger = value;
+                    } else if ( key.equals(KEY_LOGGING_BOOTSTRAP_LOGLEVEL) ) {
+                        this.bootstrapLogLevel = value;
+                    } else if ( key.equals(KEY_LOGGING_MANAGER_CLASS) ) {
+                        this.loggerClassName = value;
+                    } else if ( key.equals(KEY_LOGGING_LOG4J_CONFIGURATION) ) {
+                        this.log4jConfiguration = value;
+                    } else if ( key.equals(KEY_ALLOW_RELOAD) ) {
+                        this.allowReload = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_UPLOADS_ENABLE) ) {
+                        this.enableUploads = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_UPLOADS_DIRECTORY) ) {
+                        this.uploadDirectory = value;
+                    } else if ( key.equals(KEY_UPLOADS_AUTOSAVE) ) {
+                        this.autosaveUploads = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_UPLOADS_OVERWRITE) ) {
+                        this.overwriteUploads = value;
+                    } else if ( key.equals(KEY_UPLOADS_MAXSIZE) ) {
+                        this.maxUploadSize = NumberUtils.toInt(value);
+                    } else if ( key.equals(KEY_CACHE_DIRECTORY) ) {
+                        this.cacheDirectory = value;
+                    } else if ( key.equals(KEY_WORK_DIRECTORY) ) {
+                        this.workDirectory = value;
+                    } else if ( key.equals(KEY_PARENT_SERVICE_MANAGER) ) {
+                        this.parentServiceManagerClassName = value;
+                    } else if ( key.equals(KEY_SHOWTIME) ) {
+                        this.showTime = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_HIDE_SHOWTIME) ) {
+                        this.hideShowTime = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_MANAGE_EXCEPTIONS) ) {
+                        this.manageExceptions = BooleanUtils.toBoolean(value);
+                    } else if ( key.equals(KEY_FORM_ENCODING) ) {
+                        this.formEncoding = value;
+                    } else if ( key.equals(KEY_LOGGING_OVERRIDE_LOGLEVEL) ) {
+                        this.overrideLogLevel = value;
+                    } else if ( key.equals(KEY_LAZY_MODE) ) {
+                        this.lazyMode = BooleanUtils.toBoolean(value);
+                    }
+                }
+            }
+            this.properties.add(props);
+        }
+    }
+
+    /**
+     * @param hideShowTime The hideShowTime to set.
+     */
+    public void setHideShowTime(boolean hideShowTime) {
+        this.checkWriteable();
+        this.hideShowTime = hideShowTime;
+    }
+
+    /**
+     * @param allowReload The allowReload to set.
+     */
+    public void setAllowReload(boolean allowReload) {
+        this.checkWriteable();
+        this.allowReload = allowReload;
+    }
+
+    /**
+     * @param autosaveUploads The autosaveUploads to set.
+     */
+    public void setAutosaveUploads(boolean autosaveUploads) {
+        this.checkWriteable();
+        this.autosaveUploads = autosaveUploads;
+    }
+
+    /**
+     * @param cacheDirectory The cacheDirectory to set.
+     */
+    public void setCacheDirectory(String cacheDirectory) {
+        this.checkWriteable();
+        this.cacheDirectory = cacheDirectory;
+    }
+
+    /**
+     * @param cocoonLogger The cocoonLogger to set.
+     */
+    public void setCocoonLogger(String cocoonLogger) {
+        this.checkWriteable();
+        this.cocoonLogger = cocoonLogger;
+    }
+
+    /**
+     * @param configuration The configuration to set.
+     */
+    public void setConfiguration(String configuration) {
+        this.checkWriteable();
+        this.configuration = configuration;
+    }
+
+    /**
+     * @param enableUploads The enableUploads to set.
+     */
+    public void setEnableUploads(boolean enableUploads) {
+        this.checkWriteable();
+        this.enableUploads = enableUploads;
+    }
+
+    /**
+     * @param extraClasspath The extraClasspaths to set.
+     */
+    public void addToExtraClasspaths(String extraClasspath) {
+        this.checkWriteable();
+        this.extraClasspaths.add(extraClasspath);
+    }
+
+    /**
+     * @param key The forceProperties to set.
+     * @param value The forceProperties value to set.
+     */
+    public void addToForceProperties(String key, String value) {
+        this.checkWriteable();
+        this.forceProperties.put(key, value);
+    }
+
+    /**
+     * @param formEncoding The formEncoding to set.
+     */
+    public void setFormEncoding(String formEncoding) {
+        this.checkWriteable();
+        this.formEncoding = formEncoding;
+    }
+
+    /**
+     * @param initClassloader The initClassloader to set.
+     */
+    public void setInitClassloader(boolean initClassloader) {
+        this.checkWriteable();
+        this.initClassloader = initClassloader;
+    }
+
+    /**
+     * @param className The loadClasses to set.
+     */
+    public void addToLoadClasses(String className) {
+        this.checkWriteable();
+        this.loadClasses.add(className);
+    }
+
+    /**
+     * @param loggerClassName The loggerClassName to set.
+     */
+    public void setLoggerClassName(String loggerClassName) {
+        this.checkWriteable();
+        this.loggerClassName = loggerClassName;
+    }
+
+    /**
+     * @param loggingConfiguration The loggingConfiguration to set.
+     */
+    public void setLoggingConfiguration(String loggingConfiguration) {
+        this.checkWriteable();
+        this.loggingConfiguration = loggingConfiguration;
+    }
+
+    /**
+     * @param logLevel The logLevel to set.
+     */
+    public void setBootstrapLogLevel(String logLevel) {
+        this.checkWriteable();
+        this.bootstrapLogLevel = logLevel;
+    }
+
+    /**
+     * @param manageExceptions The manageExceptions to set.
+     */
+    public void setManageExceptions(boolean manageExceptions) {
+        this.checkWriteable();
+        this.manageExceptions = manageExceptions;
+    }
+
+    /**
+     * @param maxUploadSize The maxUploadSize to set.
+     */
+    public void setMaxUploadSize(int maxUploadSize) {
+        this.checkWriteable();
+        this.maxUploadSize = maxUploadSize;
+    }
+
+    /**
+     * @param overwriteUploads The overwriteUploads to set.
+     */
+    public void setOverwriteUploads(String overwriteUploads) {
+        this.checkWriteable();
+        this.overwriteUploads = overwriteUploads;
+    }
+    
+    /**
+     * @param parentServiceManagerClassName The parentServiceManagerClassName to set.
+     */
+    public void setParentServiceManagerClassName(
+            String parentServiceManagerClassName) {
+        this.checkWriteable();
+        this.parentServiceManagerClassName = parentServiceManagerClassName;
+    }
+
+    /**
+     * @param showTime The showTime to set.
+     */
+    public void setShowTime(boolean showTime) {
+        this.checkWriteable();
+        this.showTime = showTime;
+    }
+
+    /**
+     * @param uploadDirectory The uploadDirectory to set.
+     */
+    public void setUploadDirectory(String uploadDirectory) {
+        this.checkWriteable();
+        this.uploadDirectory = uploadDirectory;
+    }
+
+    /**
+     * @param workDirectory The workDirectory to set.
+     */
+    public void setWorkDirectory(String workDirectory) {
+        this.checkWriteable();
+        this.workDirectory = workDirectory;
+    }
+
+    /**
+     * @param log4jConfiguration The log4jConfiguration to set.
+     */
+    public void setLog4jConfiguration(String log4jConfiguration) {
+        this.checkWriteable();
+        this.log4jConfiguration = log4jConfiguration;
+    }
+
+    /**
+     * @param servletLogger The servletLogger to set.
+     */
+    public void setAccessLogger(String servletLogger) {
+        this.checkWriteable();
+        this.accessLogger = servletLogger;
+    }
+
+    /**
+     * @param overrideLogLevel The overrideLogLevel to set.
+     */
+    public void setOverrideLogLevel(String overrideLogLevel) {
+        this.checkWriteable();
+        this.overrideLogLevel = overrideLogLevel;
+    }
+
+    /**
+     * @param configurationReloadDelay The configurationReloadDelay to set.
+     */
+    public void setConfigurationReloadDelay(long configurationReloadDelay) {
+        this.checkWriteable();
+        this.configurationReloadDelay = configurationReloadDelay;
+    }
+
+    /**
+     * @param lazyMode The lazyMode to set.
+     */
+    public void setLazyMode(boolean lazyMode) {
+        this.checkWriteable();
+        this.lazyMode = lazyMode;
+    }
+
+    /**
+     * Mark this object as read-only.
+     */
+    public void makeReadOnly() {
+        this.readOnly = false;
+    }
+
+    /**
+     * check if this configuration is writeable.
+     *
+     * @throws IllegalStateException if this setting is read-only
+     */
+    protected final void checkWriteable()
+    throws IllegalStateException {
+        if( this.readOnly ) {
+            throw new IllegalStateException
+                ( "Settings is read only and can not be modified" );
+        }
+    }
+
+}

Propchange: cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/src/java/org/apache/cocoon/core/MutableSettings.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/Settings.java Sun May 22 09:59:13 2005
@@ -22,17 +22,12 @@
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.lang.math.NumberUtils;
-
 /**
  * This object holds the global configuration of Cocoon.
  *
  * @version SVN $Id$
  */
-public class Settings implements BaseSettings, DynamicSettings{
-
-    protected boolean readOnly = false;
+public class Settings implements BaseSettings, DynamicSettings {
 
     /** Prefix for properties */
     protected static final String KEYPREFIX = "org.apache.cocoon.";
@@ -236,87 +231,11 @@
     }
 
     /**
-     * Fill from a properties object
-     */
-    public void fill(Properties props) {
-        this.checkWriteable();
-        if ( props != null ) {
-            final Iterator i = props.entrySet().iterator();
-            while ( i.hasNext() ) {
-                final Map.Entry current = (Map.Entry)i.next();
-                String key = current.getKey().toString();
-                if ( key.startsWith(KEYPREFIX) ) {
-                    key = key.substring(KEYPREFIX.length());
-                    final String value = current.getValue().toString();
-
-                    if ( key.equals(KEY_INIT_CLASSLOADER) ) {
-                        this.initClassloader = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_CONFIGURATION) ) {
-                        this.configuration = value;
-                    } else if ( key.equals(KEY_CONFIGURATION_RELOAD_DELAY) ) {
-                        this.configurationReloadDelay = NumberUtils.toLong(value);
-                    } else if ( key.equals(KEY_LOGGING_CONFIGURATION) ) {
-                        this.loggingConfiguration = value;
-                    } else if ( key.equals(KEY_LOGGING_ACCESS_LOGGER) ) {
-                        this.accessLogger = value;
-                    } else if ( key.equals(KEY_LOGGING_COCOON_LOGGER) ) {
-                        this.cocoonLogger = value;
-                    } else if ( key.equals(KEY_LOGGING_BOOTSTRAP_LOGLEVEL) ) {
-                        this.bootstrapLogLevel = value;
-                    } else if ( key.equals(KEY_LOGGING_MANAGER_CLASS) ) {
-                        this.loggerClassName = value;
-                    } else if ( key.equals(KEY_LOGGING_LOG4J_CONFIGURATION) ) {
-                        this.log4jConfiguration = value;
-                    } else if ( key.equals(KEY_ALLOW_RELOAD) ) {
-                        this.allowReload = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_UPLOADS_ENABLE) ) {
-                        this.enableUploads = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_UPLOADS_DIRECTORY) ) {
-                        this.uploadDirectory = value;
-                    } else if ( key.equals(KEY_UPLOADS_AUTOSAVE) ) {
-                        this.autosaveUploads = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_UPLOADS_OVERWRITE) ) {
-                        this.overwriteUploads = value;
-                    } else if ( key.equals(KEY_UPLOADS_MAXSIZE) ) {
-                        this.maxUploadSize = NumberUtils.toInt(value);
-                    } else if ( key.equals(KEY_CACHE_DIRECTORY) ) {
-                        this.cacheDirectory = value;
-                    } else if ( key.equals(KEY_WORK_DIRECTORY) ) {
-                        this.workDirectory = value;
-                    } else if ( key.equals(KEY_PARENT_SERVICE_MANAGER) ) {
-                        this.parentServiceManagerClassName = value;
-                    } else if ( key.equals(KEY_SHOWTIME) ) {
-                        this.showTime = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_HIDE_SHOWTIME) ) {
-                        this.hideShowTime = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_MANAGE_EXCEPTIONS) ) {
-                        this.manageExceptions = BooleanUtils.toBoolean(value);
-                    } else if ( key.equals(KEY_FORM_ENCODING) ) {
-                        this.formEncoding = value;
-                    } else if ( key.equals(KEY_LOGGING_OVERRIDE_LOGLEVEL) ) {
-                        this.overrideLogLevel = value;
-                    } else if ( key.equals(KEY_LAZY_MODE) ) {
-                        this.lazyMode = BooleanUtils.toBoolean(value);
-                    }
-                }
-            }
-            this.properties.add(props);
-        }
-    }
-
-    /**
      * @return Returns the hideShowTime.
      */
     public boolean isHideShowTime() {
         return this.hideShowTime;
     }
-    /**
-     * @param hideShowTime The hideShowTime to set.
-     */
-    public void setHideShowTime(boolean hideShowTime) {
-        this.checkWriteable();
-        this.hideShowTime = hideShowTime;
-    }
 
     /**
      * @return Returns the allowReload.
@@ -324,13 +243,6 @@
     public boolean isAllowReload() {
         return this.allowReload;
     }
-    /**
-     * @param allowReload The allowReload to set.
-     */
-    public void setAllowReload(boolean allowReload) {
-        this.checkWriteable();
-        this.allowReload = allowReload;
-    }
 
     /**
      * @return Returns the autosaveUploads.
@@ -340,14 +252,6 @@
     }
 
     /**
-     * @param autosaveUploads The autosaveUploads to set.
-     */
-    public void setAutosaveUploads(boolean autosaveUploads) {
-        this.checkWriteable();
-        this.autosaveUploads = autosaveUploads;
-    }
-
-    /**
      * @return Returns the cacheDirectory.
      */
     public String getCacheDirectory() {
@@ -355,27 +259,11 @@
     }
 
     /**
-     * @param cacheDirectory The cacheDirectory to set.
-     */
-    public void setCacheDirectory(String cacheDirectory) {
-        this.checkWriteable();
-        this.cacheDirectory = cacheDirectory;
-    }
-
-    /**
      * @return Returns the cocoonLogger.
      */
     public String getCocoonLogger() {
         return this.cocoonLogger;
     }
-    
-    /**
-     * @param cocoonLogger The cocoonLogger to set.
-     */
-    public void setCocoonLogger(String cocoonLogger) {
-        this.checkWriteable();
-        this.cocoonLogger = cocoonLogger;
-    }
 
     /**
      * @return Returns the configuration.
@@ -383,14 +271,6 @@
     public String getConfiguration() {
         return this.configuration;
     }
-    
-    /**
-     * @param configuration The configuration to set.
-     */
-    public void setConfiguration(String configuration) {
-        this.checkWriteable();
-        this.configuration = configuration;
-    }
 
     /**
      * @return Returns the enableUploads.
@@ -398,14 +278,6 @@
     public boolean isEnableUploads() {
         return this.enableUploads;
     }
-    
-    /**
-     * @param enableUploads The enableUploads to set.
-     */
-    public void setEnableUploads(boolean enableUploads) {
-        this.checkWriteable();
-        this.enableUploads = enableUploads;
-    }
 
     /**
      * @return Returns the extraClasspaths.
@@ -413,14 +285,6 @@
     public List getExtraClasspaths() {
         return this.extraClasspaths;
     }
-    
-    /**
-     * @param extraClasspath The extraClasspaths to set.
-     */
-    public void addToExtraClasspaths(String extraClasspath) {
-        this.checkWriteable();
-        this.extraClasspaths.add(extraClasspath);
-    }
 
     /**
      * @return Returns the forceProperties.
@@ -430,15 +294,6 @@
     }
 
     /**
-     * @param key The forceProperties to set.
-     * @param value The forceProperties value to set.
-     */
-    public void addToForceProperties(String key, String value) {
-        this.checkWriteable();
-        this.forceProperties.put(key, value);
-    }
-
-    /**
      * @return Returns the formEncoding.
      */
     public String getFormEncoding() {
@@ -446,27 +301,11 @@
     }
 
     /**
-     * @param formEncoding The formEncoding to set.
-     */
-    public void setFormEncoding(String formEncoding) {
-        this.checkWriteable();
-        this.formEncoding = formEncoding;
-    }
-
-    /**
      * @return Returns the initClassloader.
      */
     public boolean isInitClassloader() {
         return this.initClassloader;
     }
-    
-    /**
-     * @param initClassloader The initClassloader to set.
-     */
-    public void setInitClassloader(boolean initClassloader) {
-        this.checkWriteable();
-        this.initClassloader = initClassloader;
-    }
 
     /**
      * @return Returns the loadClasses.
@@ -476,14 +315,6 @@
     }
 
     /**
-     * @param className The loadClasses to set.
-     */
-    public void addToLoadClasses(String className) {
-        this.checkWriteable();
-        this.loadClasses.add(className);
-    }
-
-    /**
      * @return Returns the loggerClassName.
      */
     public String getLoggerClassName() {
@@ -491,27 +322,11 @@
     }
 
     /**
-     * @param loggerClassName The loggerClassName to set.
-     */
-    public void setLoggerClassName(String loggerClassName) {
-        this.checkWriteable();
-        this.loggerClassName = loggerClassName;
-    }
-
-    /**
      * @return Returns the loggingConfiguration.
      */
     public String getLoggingConfiguration() {
         return this.loggingConfiguration;
     }
-    
-    /**
-     * @param loggingConfiguration The loggingConfiguration to set.
-     */
-    public void setLoggingConfiguration(String loggingConfiguration) {
-        this.checkWriteable();
-        this.loggingConfiguration = loggingConfiguration;
-    }
 
     /**
      * @return Returns the logLevel.
@@ -519,14 +334,6 @@
     public String getBootstrapLogLevel() {
         return this.bootstrapLogLevel;
     }
-    
-    /**
-     * @param logLevel The logLevel to set.
-     */
-    public void setBootstrapLogLevel(String logLevel) {
-        this.checkWriteable();
-        this.bootstrapLogLevel = logLevel;
-    }
 
     /**
      * @return Returns the manageExceptions.
@@ -534,14 +341,6 @@
     public boolean isManageExceptions() {
         return this.manageExceptions;
     }
-    
-    /**
-     * @param manageExceptions The manageExceptions to set.
-     */
-    public void setManageExceptions(boolean manageExceptions) {
-        this.checkWriteable();
-        this.manageExceptions = manageExceptions;
-    }
 
     /**
      * @return Returns the maxUploadSize.
@@ -549,14 +348,6 @@
     public int getMaxUploadSize() {
         return this.maxUploadSize;
     }
-    
-    /**
-     * @param maxUploadSize The maxUploadSize to set.
-     */
-    public void setMaxUploadSize(int maxUploadSize) {
-        this.checkWriteable();
-        this.maxUploadSize = maxUploadSize;
-    }
 
     /**
      * @return Returns the overwriteUploads.
@@ -564,15 +355,7 @@
     public String getOverwriteUploads() {
         return this.overwriteUploads;
     }
-    
-    /**
-     * @param overwriteUploads The overwriteUploads to set.
-     */
-    public void setOverwriteUploads(String overwriteUploads) {
-        this.checkWriteable();
-        this.overwriteUploads = overwriteUploads;
-    }
-    
+
     /**
      * @return Returns the parentServiceManagerClassName.
      */
@@ -581,28 +364,11 @@
     }
 
     /**
-     * @param parentServiceManagerClassName The parentServiceManagerClassName to set.
-     */
-    public void setParentServiceManagerClassName(
-            String parentServiceManagerClassName) {
-        this.checkWriteable();
-        this.parentServiceManagerClassName = parentServiceManagerClassName;
-    }
-
-    /**
      * @return Returns the showTime.
      */
     public boolean isShowTime() {
         return this.showTime;
     }
-    
-    /**
-     * @param showTime The showTime to set.
-     */
-    public void setShowTime(boolean showTime) {
-        this.checkWriteable();
-        this.showTime = showTime;
-    }
 
     /**
      * @return Returns the uploadDirectory.
@@ -610,14 +376,6 @@
     public String getUploadDirectory() {
         return this.uploadDirectory;
     }
-    
-    /**
-     * @param uploadDirectory The uploadDirectory to set.
-     */
-    public void setUploadDirectory(String uploadDirectory) {
-        this.checkWriteable();
-        this.uploadDirectory = uploadDirectory;
-    }
 
     /**
      * @return Returns the workDirectory.
@@ -625,14 +383,6 @@
     public String getWorkDirectory() {
         return this.workDirectory;
     }
-    
-    /**
-     * @param workDirectory The workDirectory to set.
-     */
-    public void setWorkDirectory(String workDirectory) {
-        this.checkWriteable();
-        this.workDirectory = workDirectory;
-    }
 
     /**
      * @return Returns the log4jConfiguration.
@@ -642,14 +392,6 @@
     }
 
     /**
-     * @param log4jConfiguration The log4jConfiguration to set.
-     */
-    public void setLog4jConfiguration(String log4jConfiguration) {
-        this.checkWriteable();
-        this.log4jConfiguration = log4jConfiguration;
-    }
-
-    /**
      * @return Returns the accessLogger.
      */
     public String getAccessLogger() {
@@ -657,28 +399,12 @@
     }
 
     /**
-     * @param servletLogger The servletLogger to set.
-     */
-    public void setAccessLogger(String servletLogger) {
-        this.checkWriteable();
-        this.accessLogger = servletLogger;
-    }
-
-    /**
      * @return Returns the overrideLogLevel.
      */
     public String getOverrideLogLevel() {
         return this.overrideLogLevel;
     }
 
-    /**
-     * @param overrideLogLevel The overrideLogLevel to set.
-     */
-    public void setOverrideLogLevel(String overrideLogLevel) {
-        this.checkWriteable();
-        this.overrideLogLevel = overrideLogLevel;
-    }
-
     public boolean isAllowOverwrite() {
         if ("deny".equalsIgnoreCase(this.overwriteUploads)) {
             return false;
@@ -709,14 +435,6 @@
     }
 
     /**
-     * @param configurationReloadDelay The configurationReloadDelay to set.
-     */
-    public void setConfigurationReloadDelay(long configurationReloadDelay) {
-        this.checkWriteable();
-        this.configurationReloadDelay = configurationReloadDelay;
-    }
-
-    /**
      * @return Returns the lazyMode.
      */
     public boolean isLazyMode() {
@@ -724,14 +442,6 @@
     }
 
     /**
-     * @param lazyMode The lazyMode to set.
-     */
-    public void setLazyMode(boolean lazyMode) {
-        this.checkWriteable();
-        this.lazyMode = lazyMode;
-    }
-
-    /**
      * @see java.lang.Object#toString()
      */
     public String toString() {
@@ -837,26 +547,6 @@
             value = defaultValue;
         }
         return value;
-    }
-
-    /**
-     * Mark this object as read-only.
-     */
-    public void makeReadOnly() {
-        this.readOnly = false;
-    }
-
-    /**
-     * check if this configuration is writeable.
-     *
-     * @throws IllegalStateException if this setting is read-only
-     */
-    protected final void checkWriteable()
-    throws IllegalStateException {
-        if( this.readOnly ) {
-            throw new IllegalStateException
-                ( "Settings is read only and can not be modified" );
-        }
     }
 
 }

Modified: cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Sun
May 22 09:59:13 2005
@@ -21,7 +21,6 @@
 import org.apache.cocoon.Constants;
 import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.core.Core;
-import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.util.ClassUtils;
 import org.apache.cocoon.util.TraxErrorHandler;
 import org.apache.cocoon.xml.AbstractXMLPipe;

Modified: cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/servlet/CocoonServlet.java Sun May 22 09:59:13
2005
@@ -51,6 +51,7 @@
 import org.apache.cocoon.components.notification.Notifying;
 import org.apache.cocoon.core.BootstrapEnvironment;
 import org.apache.cocoon.core.CoreUtil;
+import org.apache.cocoon.core.MutableSettings;
 import org.apache.cocoon.core.Settings;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.Environment;
@@ -689,7 +690,7 @@
         /**
          * @see org.apache.cocoon.core.BootstrapEnvironment#configure(org.apache.cocoon.configuration.Settings)
          */
-        public void configure(Settings settings) {
+        public void configure(MutableSettings settings) {
             // fill from the servlet parameters
             SettingsHelper.fill(settings, this.config);
             if ( settings.getWorkDirectory() == null ) {

Modified: cocoon/trunk/src/java/org/apache/cocoon/servlet/SettingsHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/servlet/SettingsHelper.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/servlet/SettingsHelper.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/servlet/SettingsHelper.java Sun May 22 09:59:13
2005
@@ -19,7 +19,7 @@
 
 import javax.servlet.ServletConfig;
 
-import org.apache.cocoon.core.Settings;
+import org.apache.cocoon.core.MutableSettings;
 import org.apache.cocoon.util.StringUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.SystemUtils;
@@ -36,7 +36,7 @@
         //  no instantiation
     }
     
-    public static void fill(Settings s, ServletConfig config) {
+    public static void fill(MutableSettings s, ServletConfig config) {
         String value;
 
         s.setInitClassloader(getInitParameterAsBoolean(config, "init-classloader", s.isInitClassloader()));
@@ -152,7 +152,7 @@
         return Integer.parseInt(value);
     }
     
-    private static void handleLoadClass(String param, Settings s) {
+    private static void handleLoadClass(String param, MutableSettings s) {
         if ( param == null ) {
             return;
         }
@@ -170,7 +170,7 @@
      * separate each entry with whitespace, a comma, or a semi-colon.
      * Cocoon will strip any whitespace from the entry.
      */
-    private static void handleForceProperty(String forceSystemProperty, Settings s) {
+    private static void handleForceProperty(String forceSystemProperty, MutableSettings s)
{
         if (forceSystemProperty != null) {
             StringTokenizer tokenizer = new StringTokenizer(forceSystemProperty, " \t\r\n\f;,",
false);
 
@@ -197,7 +197,7 @@
      * Retreives the "extra-classpath" attribute, that needs to be
      * added to the class path.
      */
-    private static void handleExtraClassPath(String extraClassPath, Settings settings) {
+    private static void handleExtraClassPath(String extraClassPath, MutableSettings settings)
{
         if (extraClassPath != null) {
             StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR,
false);
             while (st.hasMoreTokens()) {

Modified: cocoon/trunk/src/test/org/apache/cocoon/core/TestBootstrapEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/core/TestBootstrapEnvironment.java?rev=171343&r1=171342&r2=171343&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/core/TestBootstrapEnvironment.java (original)
+++ cocoon/trunk/src/test/org/apache/cocoon/core/TestBootstrapEnvironment.java Sun May 22
09:59:13 2005
@@ -92,7 +92,7 @@
         }
     }
     
-    public void configure(Settings settings) {
+    public void configure(MutableSettings settings) {
         settings.setConfiguration(this.configuration);
         settings.setWorkDirectory("work");
     }



Mime
View raw message