You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/03/05 12:37:02 UTC

svn commit: r383306 - in /cocoon/trunk: cocoon-core/src/main/java/org/apache/cocoon/core/ cocoon-core/src/main/java/org/apache/cocoon/generation/ cocoon-core/src/main/java/org/apache/cocoon/servlet/ cocoon-portal/cocoon-portal-impl/src/main/java/org/ap...

Author: cziegeler
Date: Sun Mar  5 03:36:59 2006
New Revision: 383306

URL: http://svn.apache.org/viewcvs?rev=383306&view=rev
Log:
Remove extra classpath handling

Modified:
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/MutableSettings.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
    cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/servlet/SettingsHelper.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portlet/SettingsHelper.java
    cocoon/trunk/cocoon-webapp/src/main/webapp/WEB-INF/properties/core.properties

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/BaseSettings.java Sun Mar  5 03:36:59 2006
@@ -74,14 +74,6 @@
     String KEY_LOAD_CLASSES = "classloader.load.classes";
 
     /**
-     * This parameter allows to specify additional directories or jars
-     * which Cocoon should put into it's own classpath.
-     * Note that absolute pathes are taken as such but relative pathes
-     * are rooted at the context root of the Cocoon servlet.
-     */
-    String KEY_EXTRA_CLASSPATHS = "extra.classpaths";
-
-    /**
      * This parameter indicates the category id of the logger from the LogKit
      * configuration used by the environment.
      */
@@ -155,12 +147,6 @@
      * @see #KEY_CONFIGURATION
      */
     String getConfiguration();
-
-    /**
-     * @return Returns the extraClasspaths.
-     * @see #KEY_EXTRA_CLASSPATHS
-     */
-    List getExtraClasspaths();
 
     /**
      * @return Returns the loadClasses.

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/CoreUtil.java Sun Mar  5 03:36:59 2006
@@ -52,7 +52,6 @@
 import org.apache.cocoon.core.container.util.SimpleSourceResolver;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.util.ClassUtils;
-import org.apache.cocoon.util.StringUtils;
 import org.apache.cocoon.util.location.Location;
 import org.apache.cocoon.util.location.LocationImpl;
 import org.apache.cocoon.util.location.LocationUtils;
@@ -744,19 +743,6 @@
      * of this class (eg. Cocoon Context).
      */
     protected void updateEnvironment() throws Exception {
-//        // concatenate the class path and the extra class path
-//        String classPath = this.env.getClassPath(this.settings);
-//        StringBuffer buffer = new StringBuffer();
-//        if ( classPath != null && classPath.length() > 0 ) {
-//            buffer.append(classPath);
-//        }
-//        classPath = this.getExtraClassPath();
-//        if ( classPath != null && classPath.length() > 0 ) {
-//            if ( buffer.length() > 0 ) {
-//                buffer.append(File.pathSeparatorChar);
-//            }
-//            buffer.append(classPath);
-//        }
         // FIXME - for now we just set an empty string as this information is looked up
         //         by other components
         this.appContext.put(Constants.CONTEXT_CLASSPATH, "");
@@ -774,48 +760,6 @@
 
     public ConfigurableBeanFactory getContainer() {
         return this.container;
-    }
-
-    /**
-     * Retreives the "extra-classpath" attribute, that needs to be
-     * added to the class path.
-     */
-    protected String getExtraClassPath() {
-        if (this.settings.getExtraClasspaths().size() > 0) {
-            StringBuffer sb = new StringBuffer();
-            final Iterator iter = this.settings.getExtraClasspaths().iterator();
-            int i = 0;
-            while (iter.hasNext()) {
-                String s = (String)iter.next();
-                if (i++ > 0) {
-                    sb.append(File.pathSeparatorChar);
-                }
-                if ((s.charAt(0) == File.separatorChar) ||
-                        (s.charAt(1) == ':')) {
-                    if (this.log.isDebugEnabled()) {
-                        this.log.debug("extraClassPath is absolute: " + s);
-                    }
-                    sb.append(s);
-
-                } else {
-                    if (s.indexOf("${") != -1) {
-                        String path = StringUtils.replaceToken(s);
-                        sb.append(path);
-                        if (this.log.isDebugEnabled()) {
-                            this.log.debug("extraClassPath is not absolute replacing using token: [" + s + "] : " + path);
-                        }
-                    } else {
-                        String path = this.settings.getWorkDirectory() + s;
-                        if (this.log.isDebugEnabled()) {
-                            this.log.debug("extraClassPath is not absolute pre-pending work-directory: " + path);
-                        }
-                        sb.append(path);
-                    }
-                }
-            }
-            return sb.toString();
-        }
-        return "";
     }
 
     protected static final class LoggerWrapper implements Logger {

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/MutableSettings.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/MutableSettings.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/MutableSettings.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/core/MutableSettings.java Sun Mar  5 03:36:59 2006
@@ -146,14 +146,6 @@
     protected String workDirectory;
 
     /**
-     * This parameter allows to specify additional directories or jars
-     * which Cocoon should put into it's own classpath.
-     * Note that absolute pathes are taken as such but relative pathes
-     * are rooted at the context root of the Cocoon servlet.
-     */
-    protected List extraClasspaths = new ArrayList();
-
-    /**
      * Allow adding processing time to the response
      */
     protected boolean showTime = SHOW_TIME;
@@ -263,8 +255,6 @@
                         this.overrideLogLevel = value;
                     } else if ( key.startsWith(KEY_LOAD_CLASSES) ) {
                         this.addToLoadClasses(value);
-                    } else if ( key.startsWith(KEY_EXTRA_CLASSPATHS) ) {
-                        this.addToExtraClasspaths(value);
                     } else if ( key.startsWith(KEY_PROPERTY_PROVIDER) ) {
                         this.addToPropertyProviders(value);
                     }
@@ -338,13 +328,6 @@
     }
 
     /**
-     * @return Returns the extraClasspaths.
-     */
-    public List getExtraClasspaths() {
-        return this.extraClasspaths;
-    }
-
-    /**
      * @return Returns the formEncoding.
      */
     public String getFormEncoding() {
@@ -524,8 +507,6 @@
                 value = this.overrideLogLevel;
             } else if ( key.equals(KEY_LOAD_CLASSES) ) {
                 value = this.toString(this.loadClasses);
-            } else if ( key.equals(KEY_EXTRA_CLASSPATHS) ) {
-                this.toString(this.extraClasspaths);
             } else if ( key.equals(KEY_PROPERTY_PROVIDER) ) {
                 this.toString(this.propertyProviders);
             }
@@ -553,7 +534,6 @@
           KEY_CONFIGURATION + " : " + this.configuration + '\n' +
           KEY_RELOAD_DELAY + " : " + this.configurationReloadDelay + '\n' +
           KEY_RELOADING + " : " + this.reloadingEnabled + '\n' +
-          KEY_EXTRA_CLASSPATHS + " : " + this.toString(this.extraClasspaths) + '\n' +
           KEY_LOAD_CLASSES + " : " + this.toString(this.loadClasses) + '\n' +
           KEY_LOGGING_CONFIGURATION + " : " + this.loggingConfiguration + '\n' +
           KEY_LOGGING_ENVIRONMENT_LOGGER + " : " + this.environmentLogger + '\n' +
@@ -676,14 +656,6 @@
     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);
     }
 
     /**

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/generation/StatusGenerator.java Sun Mar  5 03:36:59 2006
@@ -473,7 +473,6 @@
         this.addValue("Running mode", s.getProperty(Settings.PROPERTY_RUNNING_MODE,
                                                     Settings.DEFAULT_RUNNING_MODE));
         this.addValue(Settings.KEY_CONFIGURATION, s.getConfiguration());
-        this.addMultilineValue(Settings.KEY_EXTRA_CLASSPATHS, s.getExtraClasspaths());
         this.addMultilineValue(Settings.KEY_LOAD_CLASSES, s.getLoadClasses());
         this.addValue(Settings.KEY_PROPERTY_PROVIDER, s.getPropertyProviders());
         this.addValue(Settings.KEY_LOGGING_CONFIGURATION, s.getLoggingConfiguration());

Modified: cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/servlet/SettingsHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/servlet/SettingsHelper.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/servlet/SettingsHelper.java (original)
+++ cocoon/trunk/cocoon-core/src/main/java/org/apache/cocoon/servlet/SettingsHelper.java Sun Mar  5 03:36:59 2006
@@ -21,7 +21,6 @@
 
 import org.apache.cocoon.core.MutableSettings;
 import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.lang.SystemUtils;
 
 /**
  * This helper class initializes the {@link MutableSettings} object from the servlet
@@ -95,8 +94,6 @@
             s.setWorkDirectory(value);
         }
 
-        handleExtraClassPath(config.getInitParameter("extra-classpath"), s);
-
         value = getInitParameter(config, "show-time");
         if ( value != null && value.equalsIgnoreCase("hide") ) {
             s.setShowTime(true);
@@ -142,20 +139,6 @@
         while (tokenizer.hasMoreTokens()) {
             final String value = tokenizer.nextToken().trim();
             s.addToLoadClasses(value);
-        }
-    }
-
-    /**
-     * Retreives the "extra-classpath" attribute, that needs to be
-     * added to the class path.
-     */
-    private static void handleExtraClassPath(String extraClassPath, MutableSettings settings) {
-        if (extraClassPath != null) {
-            StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR, false);
-            while (st.hasMoreTokens()) {
-                String s = st.nextToken();
-                settings.addToExtraClasspaths(s);
-            }
         }
     }
 

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portlet/SettingsHelper.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portlet/SettingsHelper.java?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portlet/SettingsHelper.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portlet/SettingsHelper.java Sun Mar  5 03:36:59 2006
@@ -21,7 +21,6 @@
 
 import org.apache.cocoon.core.MutableSettings;
 import org.apache.commons.lang.BooleanUtils;
-import org.apache.commons.lang.SystemUtils;
 
 /**
  * This helper class initializes the {@link MutableSettings} object from the servlet
@@ -95,8 +94,6 @@
             s.setWorkDirectory(value);
         }
 
-        handleExtraClassPath(config.getInitParameter("extra-classpath"), s);
-
         value = getInitParameter(config, "show-time");
         if ( value != null && value.equalsIgnoreCase("hide") ) {
             s.setShowTime(true);
@@ -140,20 +137,6 @@
         while (tokenizer.hasMoreTokens()) {
             final String value = tokenizer.nextToken().trim();
             s.addToLoadClasses(value);
-        }
-    }
-
-    /**
-     * Retreives the "extra-classpath" attribute, that needs to be
-     * added to the class path.
-     */
-    private static void handleExtraClassPath(String extraClassPath, MutableSettings settings) {
-        if (extraClassPath != null) {
-            StringTokenizer st = new StringTokenizer(extraClassPath, SystemUtils.PATH_SEPARATOR, false);
-            while (st.hasMoreTokens()) {
-                String s = st.nextToken();
-                settings.addToExtraClasspaths(s);
-            }
         }
     }
 

Modified: cocoon/trunk/cocoon-webapp/src/main/webapp/WEB-INF/properties/core.properties
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-webapp/src/main/webapp/WEB-INF/properties/core.properties?rev=383306&r1=383305&r2=383306&view=diff
==============================================================================
--- cocoon/trunk/cocoon-webapp/src/main/webapp/WEB-INF/properties/core.properties (original)
+++ cocoon/trunk/cocoon-webapp/src/main/webapp/WEB-INF/properties/core.properties Sun Mar  5 03:36:59 2006
@@ -117,25 +117,6 @@
 # For IBM WebSphere:
 #org.apache.cocoon.classloader.load.classes.websphere=com.ibm.servlet.classloader.Handler
 
-# This parameter allows to specify additional directories or jars
-# which Cocoon should put into it's own classpath.
-# Note that absolute
-# pathes are taken as such but relative pathes are rooted at the context
-# root of the Cocoon servlet.
-#org.apache.cocoon.extra.classpaths.one=WEB-INF/extra-classes1:/[YOU-ABSOLUTE-PATH-TO]/own.jar
-
-# This parameter allows you to select the parent service manager.
-# The class will be instantiated via the constructor that takes a single
-# String as a parameter. That String will be equal to the text after the '/'.
-#
-# Cocoon honors the LogEnabled, Initializable and Disposable interfaces for
-# this class, if it implements them.
-#
-# If you uncomment the following lines the parent CM is set to the Parent CM
-# sample, which will look up a configuration via JNDI at
-# org/apache/cocoon/samples/parentcm/ParentCMConfiguration and use it.
-#org.apache.cocoon.parentservicemanager=org.apache.cocoon.samples.parentcm.ParentServiceManager/org/apache/cocoon/samples/parentcm/ParentCMConfiguration
-
 # If you set this parameter to 'true' or 'yes', Cocoon will add processing
 # time to the end of each response. Value 'hide' adds processing time as an
 # HTML comment. By default, processing time is not added (corresponds to