commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r1364104 - in /commons/proper/chain/trunk: configuration/src/main/java/org/apache/commons/chain2/config/ configuration/src/test/java/org/apache/commons/chain2/config/ src/changes/ web/src/main/java/org/apache/commons/chain2/web/ web/src/mai...
Date Sat, 21 Jul 2012 14:25:54 GMT
Author: elijah
Date: Sat Jul 21 14:25:54 2012
New Revision: 1364104

URL: http://svn.apache.org/viewvc?rev=1364104&view=rev
Log:
CHAIN-71

Removed methods and code paths that were marked deprecated in chain 1.xx.


Modified:
    commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
    commons/proper/chain/trunk/configuration/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java
    commons/proper/chain/trunk/src/changes/changes.xml
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
    commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java

Modified: commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
(original)
+++ commons/proper/chain/trunk/configuration/src/main/java/org/apache/commons/chain2/config/ConfigParser.java
Sat Jul 21 14:25:54 2012
@@ -17,7 +17,6 @@
 package org.apache.commons.chain2.config;
 
 import org.apache.commons.chain2.Catalog;
-import org.apache.commons.chain2.Context;
 import org.apache.commons.digester3.Digester;
 import org.apache.commons.digester3.RuleSet;
 
@@ -107,37 +106,6 @@ public class ConfigParser {
     // --------------------------------------------------------- Public Methods
 
     /**
-     * <p>Parse the XML document at the specified URL, using the configured
-     * <code>RuleSet</code>, registering top level commands into the specified
-     * {@link Catalog}.  Use this method <strong>only</strong> if you have
-     * <strong>NOT</strong> included any <code>factory</code> element
in your
-     * configuration resource, and wish to supply the catalog explicitly.</p>
-     *
-     * @param <K> Context key type
-     * @param <V> Context value type
-     * @param <C> Type of the context associated with this command
-     *
-     * @param catalog {@link Catalog} into which configured chains are
-     *  to be registered
-     * @param url <code>URL</code> of the XML document to be parsed
-     *
-     * @exception Exception if a parsing error occurs
-     *
-     * @deprecated Use parse(URL) on a configuration resource with "factory"
-     *  element(s) embedded
-     */
-    @Deprecated
-    public <K, V, C extends Context<K, V>> void parse(Catalog<K, V, C>
catalog, URL url) throws Exception {
-        // Prepare our Digester instance
-        Digester digester = getDigester();
-        digester.clear();
-        digester.push(catalog);
-
-        // Parse the configuration document
-        digester.parse(url);
-    }
-
-    /**
      * <p>Parse the XML document at the specified URL using the configured
      * <code>RuleSet</code>, registering catalogs with nested chains and
      * commands as they are encountered.  Use this method <strong>only</strong>

Modified: commons/proper/chain/trunk/configuration/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/configuration/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/configuration/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java
(original)
+++ commons/proper/chain/trunk/configuration/src/test/java/org/apache/commons/chain2/config/ConfigParser2TestCase.java
Sat Jul 21 14:25:54 2012
@@ -17,33 +17,20 @@
 
 package org.apache.commons.chain2.config;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Iterator;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.CatalogFactory;
 import org.apache.commons.chain2.Command;
 import org.apache.commons.chain2.Context;
-import org.apache.commons.chain2.impl.AddingCommand;
-import org.apache.commons.chain2.impl.CatalogBase;
-import org.apache.commons.chain2.impl.CatalogFactoryBase;
-import org.apache.commons.chain2.impl.ChainBase;
-import org.apache.commons.chain2.impl.ContextBase;
-import org.apache.commons.chain2.impl.DelegatingCommand;
-import org.apache.commons.chain2.impl.DelegatingFilter;
-import org.apache.commons.chain2.impl.ExceptionCommand;
-import org.apache.commons.chain2.impl.ExceptionFilter;
-import org.apache.commons.chain2.impl.NonDelegatingCommand;
-import org.apache.commons.chain2.impl.NonDelegatingFilter;
+import org.apache.commons.chain2.impl.*;
 import org.apache.commons.digester3.Digester;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.Iterator;
+
+import static org.junit.Assert.*;
+
 
 /**
  * <p>Test case identical to {@link ConfigParserTestCase} except
@@ -337,7 +324,7 @@ public class ConfigParser2TestCase {
 
     // Load the specified catalog from the specified resource path
     protected void load(String path) throws Exception {
-        parser.parse(catalog, this.getClass().getResource(path));
+        parser.parse(this.getClass().getResource(path));
         CatalogFactory<String, Object, Context<String, Object>> catalogFactory
             = CatalogFactoryBase.getInstance();
         catalog = catalogFactory.getCatalog("foo");

Modified: commons/proper/chain/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/src/changes/changes.xml?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/src/changes/changes.xml (original)
+++ commons/proper/chain/trunk/src/changes/changes.xml Sat Jul 21 14:25:54 2012
@@ -41,6 +41,9 @@ The <action> type attribute can be add,u
 
   <body>
     <release version="2.0" description="Major release">
+      <action dev="elijah" type="update" issue="CHAIN-71">
+        Removed methods deprecated in 1.xx releases.
+      </action>
       <action dev="simonetripodi" type="add" issue="CHAIN-70">
         Add a small EDSL to simplify Chain setup and execution.
       </action>

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
(original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/ChainResources.java
Sat Jul 21 14:25:54 2012
@@ -16,18 +16,17 @@
  */
 package org.apache.commons.chain2.web;
 
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import javax.servlet.ServletContext;
-
 import org.apache.commons.chain2.Catalog;
 import org.apache.commons.chain2.config.ConfigParser;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import javax.servlet.ServletContext;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
 /**
  * <p>Utility methods for loading class loader and web application resources
  * to configure a {@link Catalog}.  These methods are shared between
@@ -85,50 +84,6 @@ final class ChainResources {
     }
 
     /**
-     * <p>Parse the specified class loader resources.</p>
-     *
-     * @param catalog {@link Catalog} we are populating
-     * @param resources Comma-delimited list of resources (or <code>null</code>)
-     * @param parser {@link ConfigParser} to use for parsing
-     *
-     * @deprecated Use the variant that does not take a catalog, on a
-     *  configuration resource containing "catalog" element(s)
-     */
-    @Deprecated
-    static void parseClassResources(Catalog catalog, String resources,
-                                    ConfigParser parser) {
-        if (resources == null) {
-            return;
-        }
-        Log log = LogFactory.getLog(ChainResources.class);
-        ClassLoader loader =
-            Thread.currentThread().getContextClassLoader();
-        if (loader == null) {
-            loader = ChainResources.class.getClassLoader();
-        }
-        String[] paths = getResourcePaths(resources);
-        String path = null;
-        try {
-            for (int i = 0; i < paths.length; i++) {
-                path = paths[i];
-                URL url = loader.getResource(path);
-                if (url == null) {
-                    throw new IllegalStateException
-                        ("Missing chain config resource '" + path + "'");
-                }
-                if (log.isDebugEnabled()) {
-                    log.debug("Loading chain config resource '" + path + "'");
-                }
-                parser.parse(catalog, url);
-            }
-        } catch (Exception e) {
-            throw new RuntimeException
-                ("Exception parsing chain config resource '" + path + "': "
-                 + e.getMessage());
-        }
-    }
-
-    /**
      * <p>Parse the specified web application resources.</p>
      *
      * @param context <code>ServletContext</code> for this web application
@@ -165,47 +120,6 @@ final class ChainResources {
     }
 
     /**
-     * <p>Parse the specified web application resources.</p>
-     *
-     * @param catalog {@link Catalog} we are populating
-     * @param context <code>ServletContext</code> for this web application
-     * @param resources Comma-delimited list of resources (or <code>null</code>)
-     * @param parser {@link ConfigParser} to use for parsing
-     *
-     * @deprecated Use the variant that does not take a catalog, on a
-     *  configuration resource containing "catalog" element(s)
-     */
-    @Deprecated
-    static void parseWebResources(Catalog catalog, ServletContext context,
-                                  String resources,
-                                  ConfigParser parser) {
-        if (resources == null) {
-            return;
-        }
-        Log log = LogFactory.getLog(ChainResources.class);
-        String[] paths = getResourcePaths(resources);
-        String path = null;
-        try {
-            for (int i = 0; i < paths.length; i++) {
-                path = paths[i];
-                URL url = context.getResource(path);
-                if (url == null) {
-                    throw new IllegalStateException
-                        ("Missing chain config resource '" + path + "'");
-                }
-                if (log.isDebugEnabled()) {
-                    log.debug("Loading chain config resource '" + path + "'");
-                }
-                parser.parse(catalog, url);
-            }
-        } catch (Exception e) {
-            throw new RuntimeException
-                ("Exception parsing chain config resource '" + path + "': "
-                 + e.getMessage());
-        }
-    }
-
-    /**
      * <p> Parse the resource string into an array of paths. Empty entries will
      * be skipped. (That is, all entries in the array are non-empty paths.)</p>
      *

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
(original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/PathInfoMapper.java
Sat Jul 21 14:25:54 2012
@@ -36,40 +36,6 @@ import javax.servlet.http.HttpServletReq
  */
 public class PathInfoMapper extends LookupCommand<String, Object, ServletWebContext>
{
 
-    // ------------------------------------------------------ Instance Variables
-
-    private String catalogKey = ChainProcessor.CATALOG_DEFAULT;
-
-    // -------------------------------------------------------------- Properties
-
-    /**
-     * <p>Return the context key under which our {@link Catalog} has been
-     * stored.</p>
-     *
-     * @return The context key for the Catalog.
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public String getCatalogKey() {
-        return (this.catalogKey);
-    }
-
-    /**
-     * <p>Set the context key under which our {@link Catalog} has been
-     * stored.</p>
-     *
-     * @param catalogKey The new catalog key
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public void setCatalogKey(String catalogKey) {
-        this.catalogKey = catalogKey;
-    }
-
     // --------------------------------------------------------- Command Methods
 
     /**

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
(original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/RequestParameterMapper.java
Sat Jul 21 14:25:54 2012
@@ -57,34 +57,6 @@ public class RequestParameterMapper
     }
 
     /**
-     * <p>Set the context key under which our {@link Catalog} has been
-     * stored.</p>
-     *
-     * @param catalogKey The new catalog key
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public void setCatalogKey(String catalogKey) {
-        this.catalogKey = catalogKey;
-    }
-
-    /**
-     * <p>Return the name of the request parameter to use for
-     * selecting the {@link Command} to be executed.</p>
-     *
-     * @return The name of the request parameter.
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public String getParameter() {
-        return (this.parameter);
-    }
-
-    /**
      * <p>Set the name of the request parameter to use for
      * selecting the {@link Command} to be executed.</p>
      *

Modified: commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
URL: http://svn.apache.org/viewvc/commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java?rev=1364104&r1=1364103&r2=1364104&view=diff
==============================================================================
--- commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
(original)
+++ commons/proper/chain/trunk/web/src/main/java/org/apache/commons/chain2/web/servlet/ServletPathMapper.java
Sat Jul 21 14:25:54 2012
@@ -36,40 +36,6 @@ import javax.servlet.http.HttpServletReq
  */
 public class ServletPathMapper extends LookupCommand<String, Object, ServletWebContext>
{
 
-    // ------------------------------------------------------ Instance Variables
-
-    private String catalogKey = ChainProcessor.CATALOG_DEFAULT;
-
-    // -------------------------------------------------------------- Properties
-
-    /**
-     * <p>Return the context key under which our {@link Catalog} has been
-     * stored.</p>
-     *
-     * @return The context key for the Catalog.
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public String getCatalogKey() {
-        return (this.catalogKey);
-    }
-
-    /**
-     * <p>Set the context key under which our {@link Catalog} has been
-     * stored.</p>
-     *
-     * @param catalogKey The new catalog key
-     *
-     * @deprecated Use catalogName to specify the name of the catalog in the
-     *  catalog factory
-     */
-    @Deprecated
-    public void setCatalogKey(String catalogKey) {
-        this.catalogKey = catalogKey;
-    }
-
     // --------------------------------------------------------- Command Methods
 
     /**



Mime
View raw message