Revert r718819 that completely broke Tomcat.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 20 Nov 2008 08:19:23 +0000 (08:19 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 20 Nov 2008 08:19:23 +0000 (08:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@719194 13f79535-47bb-0310-9956-ffa450edef68

27 files changed:
java/org/apache/catalina/connector/CoyoteAdapter.java
java/org/apache/tomcat/util/IntrospectionUtils.java
java/org/apache/tomcat/util/buf/B2CConverter.java
java/org/apache/tomcat/util/buf/MessageBytes.java
java/org/apache/tomcat/util/digester/AbstractRulesImpl.java
java/org/apache/tomcat/util/digester/CallMethodRule.java
java/org/apache/tomcat/util/digester/CallParamRule.java
java/org/apache/tomcat/util/digester/Digester.java
java/org/apache/tomcat/util/digester/FactoryCreateRule.java
java/org/apache/tomcat/util/digester/ObjectCreateRule.java
java/org/apache/tomcat/util/digester/Rule.java
java/org/apache/tomcat/util/digester/Rules.java
java/org/apache/tomcat/util/digester/RulesBase.java
java/org/apache/tomcat/util/digester/SetNextRule.java
java/org/apache/tomcat/util/digester/SetPropertiesRule.java
java/org/apache/tomcat/util/digester/SetPropertyRule.java
java/org/apache/tomcat/util/digester/SetRootRule.java
java/org/apache/tomcat/util/digester/SetTopRule.java
java/org/apache/tomcat/util/http/ServerCookie.java
java/org/apache/tomcat/util/modeler/BaseNotificationBroadcaster.java
java/org/apache/tomcat/util/modeler/Registry.java
java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java
java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
java/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
java/org/apache/tomcat/util/modeler/modules/MbeansSource.java
java/org/apache/tomcat/util/net/TcpConnectionHandler.java
java/org/apache/tomcat/util/threads/ThreadPool.java

index ea164fa..a3f6bff 100644 (file)
@@ -626,7 +626,7 @@ public class CoyoteAdapter
             }
             if (conv != null) {
                 try {
-                    conv.convert(bc, cc, cc.getBuffer().length - cc.getEnd());
+                    conv.convert(bc, cc);
                     uri.setChars(cc.getBuffer(), cc.getStart(), 
                                  cc.getLength());
                     return;
index 2a46bcb..8bc3fe6 100644 (file)
@@ -470,9 +470,25 @@ public final class IntrospectionUtils {
 
     /**
      * Replace ${NAME} with the property value
+     * 
+     * @deprecated Use the explicit method
+     */
+    public static String replaceProperties(String value, Object getter) {
+        if (getter instanceof Hashtable)
+            return replaceProperties(value, (Hashtable) getter, null);
+
+        if (getter instanceof PropertySource) {
+            PropertySource src[] = new PropertySource[] { (PropertySource) getter };
+            return replaceProperties(value, null, src);
+        }
+        return value;
+    }
+
+    /**
+     * Replace ${NAME} with the property value
      */
-    public static String replaceProperties(String value,
-            Hashtable<Object,Object> staticProp, PropertySource dynamicProp[]) {
+    public static String replaceProperties(String value, Hashtable staticProp,
+            PropertySource dynamicProp[]) {
         if (value.indexOf("$") < 0) {
             return value;
         }
index 5bf66bf..995476b 100644 (file)
@@ -67,6 +67,16 @@ public class B2CConverter {
     static final int BUFFER_SIZE=8192;
     char result[]=new char[BUFFER_SIZE];
 
+    /** Convert a buffer of bytes into a chars
+     * @deprecated
+     */
+    public  void convert( ByteChunk bb, CharChunk cb )
+        throws IOException
+    {
+        // Set the ByteChunk as input to the Intermediate reader
+        convert(bb, cb, cb.getBuffer().length - cb.getEnd());
+    }
+
 
     public void convert( ByteChunk bb, CharChunk cb, int limit) 
         throws IOException
index 42db3c5..4e35b43 100644 (file)
@@ -68,10 +68,10 @@ public final class MessageBytes implements Cloneable, Serializable {
 
     /**
      * Creates a new, uninitialized MessageBytes object.
-     * Use static newInstance() in order to allow
+     * @deprecated Use static newInstance() in order to allow
      *   future hooks.
      */
-    private MessageBytes() {
+    public MessageBytes() {
     }
 
     /** Construct a new MessageBytes instance
index a01dfa4..d3f131c 100644 (file)
@@ -132,6 +132,22 @@ abstract public class AbstractRulesImpl implements Rules {
      * in the order originally registered through the <code>add()</code>
      * method.
      *
+     * @param pattern Nesting pattern to be matched
+     *
+     * @deprecated Call match(namespaceURI,pattern) instead.
+     */
+    public List<Rule> match(String pattern) {
+        return match(namespaceURI, pattern);
+    }
+
+
+    /**
+     * Return a List of all registered Rule instances that match the specified
+     * nesting pattern, or a zero-length List if there are no matches.  If more
+     * than one Rule instance matches, they <strong>must</strong> be returned
+     * in the order originally registered through the <code>add()</code>
+     * method.
+     *
      * @param namespaceURI Namespace URI for which to select matching rules,
      *  or <code>null</code> to match regardless of namespace URI
      * @param pattern Nesting pattern to be matched
index adb6e5b..20c2039 100644 (file)
@@ -74,6 +74,73 @@ public class CallMethodRule extends Rule {
      * Construct a "call method" rule with the specified method name.  The
      * parameter types (if any) default to java.lang.String.
      *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     * @param paramCount The number of parameters to collect, or
+     *  zero for a single argument from the body of this element.
+     *
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #CallMethodRule(String methodName,int paramCount)} instead.
+     */
+    public CallMethodRule(Digester digester, String methodName,
+                          int paramCount) {
+
+        this(methodName, paramCount);
+
+    }
+
+
+    /**
+     * Construct a "call method" rule with the specified method name.
+     *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     * @param paramCount The number of parameters to collect, or
+     *  zero for a single argument from the body of ths element
+     * @param paramTypes The Java class names of the arguments
+     *  (if you wish to use a primitive type, specify the corresonding
+     *  Java wrapper class instead, such as <code>java.lang.Boolean</code>
+     *  for a <code>boolean</code> parameter)
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #CallMethodRule(String methodName,int paramCount, String [] paramTypes)} instead.
+     */
+    public CallMethodRule(Digester digester, String methodName,
+                          int paramCount, String paramTypes[]) {
+
+        this(methodName, paramCount, paramTypes);
+
+    }
+
+
+    /**
+     * Construct a "call method" rule with the specified method name.
+     *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     * @param paramCount The number of parameters to collect, or
+     *  zero for a single argument from the body of ths element
+     * @param paramTypes The Java classes that represent the
+     *  parameter types of the method arguments
+     *  (if you wish to use a primitive type, specify the corresonding
+     *  Java wrapper class instead, such as <code>java.lang.Boolean.TYPE</code>
+     *  for a <code>boolean</code> parameter)
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #CallMethodRule(String methodName,int paramCount, Class [] paramTypes)} instead.
+     */
+    public CallMethodRule(Digester digester, String methodName,
+                          int paramCount, Class<?> paramTypes[]) {
+
+        this(methodName, paramCount, paramTypes);
+    }
+
+
+    /**
+     * Construct a "call method" rule with the specified method name.  The
+     * parameter types (if any) default to java.lang.String.
+     *
      * @param methodName Method name of the parent method to call
      * @param paramCount The number of parameters to collect, or
      *  zero for a single argument from the body of this element.
index 2cbf77d..7f80461 100644 (file)
@@ -50,6 +50,41 @@ public class CallParamRule extends Rule {
      * Construct a "call parameter" rule that will save the body text of this
      * element as the parameter value.
      *
+     * @param digester The associated Digester
+     * @param paramIndex The zero-relative parameter number
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #CallParamRule(int paramIndex)} instead.
+     */
+    public CallParamRule(Digester digester, int paramIndex) {
+
+        this(paramIndex);
+
+    }
+
+
+    /**
+     * Construct a "call parameter" rule that will save the value of the
+     * specified attribute as the parameter value.
+     *
+     * @param digester The associated Digester
+     * @param paramIndex The zero-relative parameter number
+     * @param attributeName The name of the attribute to save
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #CallParamRule(int paramIndex, String attributeName)} instead.
+     */
+    public CallParamRule(Digester digester, int paramIndex,
+                         String attributeName) {
+
+        this(paramIndex, attributeName);
+
+    }
+
+    /**
+     * Construct a "call parameter" rule that will save the body text of this
+     * element as the parameter value.
+     *
      * @param paramIndex The zero-relative parameter number
      */
     public CallParamRule(int paramIndex) {
index 7e186a1..6e88381 100644 (file)
@@ -206,6 +206,13 @@ public class Digester extends DefaultHandler {
     protected SAXParserFactory factory = null;
 
     /**
+     * @deprecated This is now managed by {@link ParserFeatureSetterFactory}
+     */
+    protected String JAXP_SCHEMA_LANGUAGE =
+        "http://java.sun.com/xml/jaxp/properties/schemaLanguage";
+    
+    
+    /**
      * The Locator associated with our parser.
      */
     protected Locator locator = null;
@@ -436,6 +443,37 @@ public class Digester extends DefaultHandler {
 
 
     /**
+     * Return the debugging detail level of our currently enabled logger.
+     *
+     * @deprecated This method now always returns 0. Digester uses the apache
+     * jakarta commons-logging library; see the documentation for that library
+     * for more information.
+     */
+    public int getDebug() {
+
+        return (0);
+
+    }
+
+
+    /**
+     * Set the debugging detail level of our currently enabled logger.
+     *
+     * @param debug New debugging detail level (0=off, increasing integers
+     *  for more detail)
+     *
+     * @deprecated This method now has no effect at all. Digester uses
+     * the apache jakarta comons-logging library; see the documentation
+     * for that library for more information.
+     */
+    public void setDebug(int debug) {
+
+        ; // No action is taken
+
+    }
+
+
+    /**
      * Return the error handler for this Digester.
      */
     public ErrorHandler getErrorHandler() {
@@ -726,6 +764,25 @@ public class Digester extends DefaultHandler {
 
 
     /**
+     * By setting the reader in the constructor, you can bypass JAXP and
+     * be able to use digester in Weblogic 6.0.  
+     *
+     * @deprecated Use getXMLReader() instead, which can throw a
+     *  SAXException if the reader cannot be instantiated
+     */
+    public XMLReader getReader() {
+
+        try {
+            return (getXMLReader());
+        } catch (SAXException e) {
+            log.error("Cannot get XMLReader", e);
+            return (null);
+        }
+
+    }
+
+
+    /**
      * Return the <code>Rules</code> implementation object containing our
      * rules collection and associated matching policy.  If none has been
      * established, a default implementation will be created and returned.
@@ -1533,6 +1590,32 @@ public class Digester extends DefaultHandler {
 
 
     /**
+     * Log a message to our associated logger.
+     *
+     * @param message The message to be logged
+     * @deprecated Call getLogger() and use it's logging methods
+     */
+    public void log(String message) {
+
+        log.info(message);
+
+    }
+
+
+    /**
+     * Log a message and exception to our associated logger.
+     *
+     * @param message The message to be logged
+     * @deprecated Call getLogger() and use it's logging methods
+     */
+    public void log(String message, Throwable exception) {
+
+        log.error(message, exception);
+
+    }
+
+
+    /**
      * Parse the content of the specified file using this Digester.  Returns
      * the root element from the object stack (if any).
      *
@@ -2609,6 +2692,26 @@ public class Digester extends DefaultHandler {
 
 
     /**
+     * Return the set of rules that apply to the specified match position.
+     * The selected rules are those that match exactly, or those rules
+     * that specify a suffix match and the tail of the rule matches the
+     * current match position.  Exact matches have precedence over
+     * suffix matches, then (among suffix matches) the longest match
+     * is preferred.
+     *
+     * @param match The current match position
+     *
+     * @deprecated Call <code>match()</code> on the <code>Rules</code>
+     *  implementation returned by <code>getRules()</code>
+     */
+    List<Rule> getRules(String match) {
+
+        return (getRules().match(match));
+
+    }
+
+
+    /**
      * <p>Return the top object on the parameters stack without removing it.  If there are
      * no objects on the stack, return <code>null</code>.</p>
      *
index c71ef79..5634a4e 100644 (file)
@@ -46,6 +46,103 @@ public class FactoryCreateRule extends Rule {
 
 
     /**
+     * Construct a factory create rule that will use the specified
+     * class name to create an {@link ObjectCreationFactory} which will
+     * then be used to create an object and push it on the stack.
+     *
+     * @param digester The associated Digester
+     * @param className Java class name of the object creation factory class
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #FactoryCreateRule(String className)} instead.
+     */
+    public FactoryCreateRule(Digester digester, String className) {
+
+        this(className);
+
+    }
+
+
+    /**
+     * Construct a factory create rule that will use the specified
+     * class to create an {@link ObjectCreationFactory} which will
+     * then be used to create an object and push it on the stack.
+     *
+     * @param digester The associated Digester
+     * @param clazz Java class name of the object creation factory class
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #FactoryCreateRule(Class clazz)} instead.
+     */
+    public FactoryCreateRule(Digester digester, Class<?> clazz) {
+
+        this(clazz);
+
+    }
+
+
+    /**
+     * Construct a factory create rule that will use the specified
+     * class name (possibly overridden by the specified attribute if present)
+     * to create an {@link ObjectCreationFactory}, which will then be used
+     * to instantiate an object instance and push it onto the stack.
+     *
+     * @param digester The associated Digester
+     * @param className Default Java class name of the factory class
+     * @param attributeName Attribute name which, if present, contains an
+     *  override of the class name of the object creation factory to create.
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #FactoryCreateRule(String className, String attributeName)} instead.
+     */
+    public FactoryCreateRule(Digester digester,
+                             String className, String attributeName) {
+
+        this(className, attributeName);
+
+    }
+
+
+    /**
+     * Construct a factory create rule that will use the specified
+     * class (possibly overridden by the specified attribute if present)
+     * to create an {@link ObjectCreationFactory}, which will then be used
+     * to instantiate an object instance and push it onto the stack.
+     *
+     * @param digester The associated Digester
+     * @param clazz Default Java class name of the factory class
+     * @param attributeName Attribute name which, if present, contains an
+     *  override of the class name of the object creation factory to create.
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #FactoryCreateRule(Class clazz, String attributeName)} instead.
+     */
+    public FactoryCreateRule(Digester digester,
+                             Class<?> clazz, String attributeName) {
+
+        this(clazz, attributeName);
+
+    }
+
+
+    /**
+     * Construct a factory create rule using the given, already instantiated,
+     * {@link ObjectCreationFactory}.
+     *
+     * @param digester The associated Digester
+     * @param creationFactory called on to create the object.
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #FactoryCreateRule(ObjectCreationFactory creationFactory)} instead.
+     */
+    public FactoryCreateRule(Digester digester,
+                             ObjectCreationFactory creationFactory) {
+
+        this(creationFactory);
+
+    }    
+
+    /**
      * <p>Construct a factory create rule that will use the specified
      * class name to create an {@link ObjectCreationFactory} which will
      * then be used to create an object and push it on the stack.</p>
index def594e..d1c4fe4 100644 (file)
@@ -38,6 +38,78 @@ public class ObjectCreateRule extends Rule {
     /**
      * Construct an object create rule with the specified class name.
      *
+     * @param digester The associated Digester
+     * @param className Java class name of the object to be created
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #ObjectCreateRule(String className)} instead.
+     */
+    public ObjectCreateRule(Digester digester, String className) {
+
+        this(className);
+
+    }
+
+
+    /**
+     * Construct an object create rule with the specified class.
+     *
+     * @param digester The associated Digester
+     * @param clazz Java class name of the object to be created
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #ObjectCreateRule(Class clazz)} instead.
+     */
+    public ObjectCreateRule(Digester digester, Class<?> clazz) {
+
+        this(clazz);
+
+    }
+
+
+    /**
+     * Construct an object create rule with the specified class name and an
+     * optional attribute name containing an override.
+     *
+     * @param digester The associated Digester
+     * @param className Java class name of the object to be created
+     * @param attributeName Attribute name which, if present, contains an
+     *  override of the class name to create
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #ObjectCreateRule(String className, String attributeName)} instead.
+     */
+    public ObjectCreateRule(Digester digester, String className,
+                            String attributeName) {
+
+        this (className, attributeName);
+
+    }
+
+
+    /**
+     * Construct an object create rule with the specified class and an
+     * optional attribute name containing an override.
+     *
+     * @param digester The associated Digester
+     * @param attributeName Attribute name which, if present, contains an
+     * @param clazz Java class name of the object to be created
+     *  override of the class name to create
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #ObjectCreateRule(String attributeName, Class clazz)} instead.
+     */
+    public ObjectCreateRule(Digester digester,
+                            String attributeName,
+                            Class<?> clazz) {
+
+        this(attributeName, clazz);
+
+    }
+
+    /**
+     * Construct an object create rule with the specified class name.
+     *
      * @param className Java class name of the object to be created
      */
     public ObjectCreateRule(String className) {
index ffb10fa..c20239c 100644 (file)
@@ -35,6 +35,19 @@ public abstract class Rule {
 
 
     /**
+     * Constructor sets the associated Digester.
+     *
+     * @param digester The digester with which this rule is associated
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. Use {@link #Rule()} instead.
+     */
+    public Rule(Digester digester) {
+
+        super();
+        setDigester(digester);
+
+    }
+    
+    /**
      * <p>Base constructor.
      * Now the digester will be set when the rule is added.</p>
      */
@@ -105,6 +118,22 @@ public abstract class Rule {
 
     /**
      * This method is called when the beginning of a matching XML element
+     * is encountered.
+     *
+     * @param attributes The attribute list of this element
+     * @deprecated Use the {@link #begin(String,String,Attributes) begin}
+     *   method with <code>namespace</code> and <code>name</code>
+     *   parameters instead.
+     */
+    public void begin(Attributes attributes) throws Exception {
+
+        ;      // The default implementation does nothing
+
+    }
+
+
+    /**
+     * This method is called when the beginning of a matching XML element
      * is encountered. The default implementation delegates to the deprecated
      * method {@link #begin(Attributes) begin} without the 
      * <code>namespace</code> and <code>name</code> parameters, to retain 
@@ -121,7 +150,24 @@ public abstract class Rule {
     public void begin(String namespace, String name, Attributes attributes)
         throws Exception {
 
-        // The default implementation does nothing
+        begin(attributes);
+
+    }
+
+
+    /**
+     * This method is called when the body of a matching XML element
+     * is encountered.  If the element has no body, this method is
+     * not called at all.
+     *
+     * @param text The text of the body of this element
+     * @deprecated Use the {@link #body(String,String,String) body} method
+     *   with <code>namespace</code> and <code>name</code> parameters
+     *   instead.
+     */
+    public void body(String text) throws Exception {
+
+        ;      // The default implementation does nothing
 
     }
 
@@ -144,7 +190,21 @@ public abstract class Rule {
     public void body(String namespace, String name, String text)
         throws Exception {
 
-        // The default implementation does nothing
+        body(text);
+
+    }
+
+
+    /**
+     * This method is called when the end of a matching XML element
+     * is encountered.
+     * 
+     * @deprecated Use the {@link #end(String,String) end} method with 
+     *   <code>namespace</code> and <code>name</code> parameters instead.
+     */
+    public void end() throws Exception {
+
+        ;      // The default implementation does nothing
 
     }
 
@@ -166,7 +226,7 @@ public abstract class Rule {
     public void end(String namespace, String name)
         throws Exception {
 
-        // The default implementation does nothing
+        end();
 
     }
 
index 37878bc..13d9ed9 100644 (file)
@@ -94,6 +94,20 @@ public interface Rules {
      * in the order originally registered through the <code>add()</code>
      * method.
      *
+     * @param pattern Nesting pattern to be matched
+     *
+     * @deprecated Call match(namespaceURI,pattern) instead.
+     */
+    public List<Rule> match(String pattern);
+
+
+    /**
+     * Return a List of all registered Rule instances that match the specified
+     * nesting pattern, or a zero-length List if there are no matches.  If more
+     * than one Rule instance matches, they <strong>must</strong> be returned
+     * in the order originally registered through the <code>add()</code>
+     * method.
+     *
      * @param namespaceURI Namespace URI for which to select matching rules,
      *  or <code>null</code> to match regardless of namespace URI
      * @param pattern Nesting pattern to be matched
index b9c4471..dd23757 100644 (file)
@@ -188,6 +188,24 @@ public class RulesBase implements Rules {
      * in the order originally registered through the <code>add()</code>
      * method.
      *
+     * @param pattern Nesting pattern to be matched
+     *
+     * @deprecated Call match(namespaceURI,pattern) instead.
+     */
+    public List<Rule> match(String pattern) {
+
+        return (match(null, pattern));
+
+    }
+
+
+    /**
+     * Return a List of all registered Rule instances that match the specified
+     * nesting pattern, or a zero-length List if there are no matches.  If more
+     * than one Rule instance matches, they <strong>must</strong> be returned
+     * in the order originally registered through the <code>add()</code>
+     * method.
+     *
      * @param namespaceURI Namespace URI for which to select matching rules,
      *  or <code>null</code> to match regardless of namespace URI
      * @param pattern Nesting pattern to be matched
index 1e6c9f4..5406300 100644 (file)
@@ -44,6 +44,44 @@ public class SetNextRule extends Rule {
      * method's argument type is assumed to be the class of the
      * child object.
      *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetNextRule(String methodName)} instead.
+     */
+    public SetNextRule(Digester digester, String methodName) {
+
+        this(methodName);
+
+    }
+
+
+    /**
+     * Construct a "set next" rule with the specified method name.
+     *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     * @param paramType Java class of the parent method's argument
+     *  (if you wish to use a primitive type, specify the corresonding
+     *  Java wrapper class instead, such as <code>java.lang.Boolean</code>
+     *  for a <code>boolean</code> parameter)
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetNextRule(String methodName,String paramType)} instead.
+     */
+    public SetNextRule(Digester digester, String methodName,
+                       String paramType) {
+
+        this(methodName, paramType);
+
+    }
+
+    /**
+     * Construct a "set next" rule with the specified method name.  The
+     * method's argument type is assumed to be the class of the
+     * child object.
+     *
      * @param methodName Method name of the parent method to call
      */
     public SetNextRule(String methodName) {
index 744f851..e68bbf1 100644 (file)
@@ -42,6 +42,21 @@ public class SetPropertiesRule extends Rule {
 
 
     /**
+     * Default constructor sets only the the associated Digester.
+     *
+     * @param digester The digester with which this rule is associated
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetPropertiesRule()} instead.
+     */
+    public SetPropertiesRule(Digester digester) {
+
+        this();
+
+    }
+    
+
+    /**
      * Base constructor.
      */
     public SetPropertiesRule() {
index 2d09707..f4b133e 100644 (file)
@@ -39,6 +39,25 @@ public class SetPropertyRule extends Rule {
      * Construct a "set property" rule with the specified name and value
      * attributes.
      *
+     * @param digester The digester with which this rule is associated
+     * @param name Name of the attribute that will contain the name of the
+     *  property to be set
+     * @param value Name of the attribute that will contain the value to which
+     *  the property should be set
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetPropertyRule(String name, String value)} instead.
+     */
+    public SetPropertyRule(Digester digester, String name, String value) {
+
+        this(name, value);
+
+    }
+
+    /**
+     * Construct a "set property" rule with the specified name and value
+     * attributes.
+     *
      * @param name Name of the attribute that will contain the name of the
      *  property to be set
      * @param value Name of the attribute that will contain the value to which
index be18c59..b801c50 100644 (file)
@@ -44,6 +44,44 @@ public class SetRootRule extends Rule {
      * method's argument type is assumed to be the class of the
      * child object.
      *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetRootRule(String methodName)} instead.
+     */
+    public SetRootRule(Digester digester, String methodName) {
+
+        this(methodName);
+
+    }
+
+
+    /**
+     * Construct a "set root" rule with the specified method name.
+     *
+     * @param digester The associated Digester
+     * @param methodName Method name of the parent method to call
+     * @param paramType Java class of the parent method's argument
+     *  (if you wish to use a primitive type, specify the corresonding
+     *  Java wrapper class instead, such as <code>java.lang.Boolean</code>
+     *  for a <code>boolean</code> parameter)
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetRootRule(String methodName,String paramType)} instead.
+     */
+    public SetRootRule(Digester digester, String methodName,
+                       String paramType) {
+
+        this(methodName, paramType);
+
+    }
+
+    /**
+     * Construct a "set root" rule with the specified method name.  The
+     * method's argument type is assumed to be the class of the
+     * child object.
+     *
      * @param methodName Method name of the parent method to call
      */
     public SetRootRule(String methodName) {
index 5bc956a..08500cd 100644 (file)
@@ -44,6 +44,44 @@ public class SetTopRule extends Rule {
      * "set parent" method's argument type is assumed to be the class of the
      * parent object.
      *
+     * @param digester The associated Digester
+     * @param methodName Method name of the "set parent" method to call
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetTopRule(String methodName)} instead.
+     */
+    public SetTopRule(Digester digester, String methodName) {
+
+        this(methodName);
+
+    }
+
+
+    /**
+     * Construct a "set parent" rule with the specified method name.
+     *
+     * @param digester The associated Digester
+     * @param methodName Method name of the "set parent" method to call
+     * @param paramType Java class of the "set parent" method's argument
+     *  (if you wish to use a primitive type, specify the corresonding
+     *  Java wrapper class instead, such as <code>java.lang.Boolean</code>
+     *  for a <code>boolean</code> parameter)
+     *
+     * @deprecated The digester instance is now set in the {@link Digester#addRule} method. 
+     * Use {@link #SetTopRule(String methodName, String paramType)} instead.
+     */
+    public SetTopRule(Digester digester, String methodName,
+                      String paramType) {
+
+        this(methodName, paramType);
+
+    }
+
+    /**
+     * Construct a "set parent" rule with the specified method name.  The
+     * "set parent" method's argument type is assumed to be the class of the
+     * parent object.
+     *
      * @param methodName Method name of the "set parent" method to call
      */
     public SetTopRule(String methodName) {
index e3a1595..6309561 100644 (file)
@@ -211,6 +211,26 @@ public class ServerCookie implements Serializable {
         return true;
     }
 
+    /**
+     * @deprecated - Not used
+     */
+    public static boolean checkName( String name ) {
+        if (!isToken(name)
+                || name.equalsIgnoreCase("Comment")     // rfc2019
+                || name.equalsIgnoreCase("Discard")     // rfc2965
+                || name.equalsIgnoreCase("Domain")      // rfc2019
+                || name.equalsIgnoreCase("Expires")     // Netscape
+                || name.equalsIgnoreCase("Max-Age")     // rfc2019
+                || name.equalsIgnoreCase("Path")        // rfc2019
+                || name.equalsIgnoreCase("Secure")      // rfc2019
+                || name.equalsIgnoreCase("Version")     // rfc2019
+                // TODO remaining RFC2965 attributes
+            ) {
+            return false;
+        }
+        return true;
+    }
+
     // -------------------- Cookie parsing tools
 
     
@@ -324,6 +344,21 @@ public class ServerCookie implements Serializable {
         headerBuf.append(buf);
     }
 
+    /**
+     * @deprecated - Not used
+     */
+    @Deprecated
+    public static void maybeQuote (int version, StringBuffer buf,String value) {
+        // special case - a \n or \r  shouldn't happen in any case
+        if (isToken(value)) {
+            buf.append(value);
+        } else {
+            buf.append('"');
+            buf.append(escapeDoubleQuotes(value,0,value.length()));
+            buf.append('"');
+        }
+    }
+    
     public static boolean alreadyQuoted (String value) {
         if (value==null || value.length()==0) return false;
         return (value.charAt(0)=='\"' && value.charAt(value.length()-1)=='\"');
index 2cf3ad2..860e630 100644 (file)
@@ -224,7 +224,7 @@ public class BaseNotificationBroadcaster implements NotificationBroadcaster {
 
     private synchronized void registerNotifications( FixedNotificationFilter filter ) {
         String names[]=filter.getNames();
-        Registry reg=Registry.getRegistry(null, null);
+        Registry reg=Registry.getRegistry();
         for( int i=0; i<names.length; i++ ) {
             int code=reg.getId(null, names[i]);
             if( hooks.length < code ) {
index 74c8fe1..a27a2fe 100644 (file)
@@ -453,6 +453,57 @@ public class Registry implements RegistryMBean, MBeanRegistration  {
         descriptorsByClass.remove( bean.getType());
     }
 
+    // -------------------- Deprecated 1.0 methods  --------------------
+    
+    /**
+     * Factory method to create (if necessary) and return our
+     * <code>MBeanServer</code> instance.
+     *
+     * @since 1.0
+     * @deprecated Use the instance method
+     */
+    public static MBeanServer getServer() {
+        return Registry.getRegistry().getMBeanServer();
+    }
+
+    /**
+     * Set the <code>MBeanServer</code> to be utilized for our
+     * registered management beans.
+     *
+     * @param mbeanServer The new <code>MBeanServer</code> instance
+     * @since 1.0
+     * @deprecated Use the instance method
+     */
+    public static void setServer(MBeanServer mbeanServer) {
+        Registry.getRegistry().setMBeanServer(mbeanServer);
+    }
+
+    /**
+     * Load the registry from the XML input found in the specified input
+     * stream.
+     *
+     * @param stream InputStream containing the registry configuration
+     *  information
+     *
+     * @exception Exception if any parsing or processing error occurs
+     * @deprecated use normal class method instead
+     * @since 1.0
+     */
+    public static void loadRegistry(InputStream stream) throws Exception {
+        Registry registry = getRegistry();
+        registry.loadMetadata(stream);
+    }
+
+    /** Get a "singelton" registry, or one per thread if setUseContextLoader 
+     * was called 
+     * 
+     * @deprecated Not enough info - use the method that takes CL and domain
+     * @since 1.0 
+     */ 
+    public synchronized static Registry getRegistry() {
+        return getRegistry(null, null);
+    }    
+
     // -------------------- Helpers  --------------------
 
     /** Get the type of an attribute of the object, from the metadata.
@@ -795,13 +846,15 @@ public class Registry implements RegistryMBean, MBeanRegistration  {
         return;
     }
 
-    /**
+    /**Experimental. Will become private, some code may still use it
+     *
      * @param sourceType
      * @param source
      * @param param
      * @throws Exception
+     * @deprecated
      */
-    private void loadDescriptors(String sourceType, Object source, String param)
+    public void loadDescriptors(String sourceType, Object source, String param)
             throws Exception {
         load(sourceType, source, param);
     }
@@ -907,7 +960,6 @@ public class Registry implements RegistryMBean, MBeanRegistration  {
     public void resetMetadata() {
         stop();
     }
-    
     /**
      * Load the registry from the XML input found in the specified input
      * stream.
@@ -922,6 +974,22 @@ public class Registry implements RegistryMBean, MBeanRegistration  {
         loadDescriptors("MbeansDescriptorsDigesterSource", source, null );
     }
 
+    /** @deprecated - may still be used in code using pre-1.1 builds
+     */
+    public void registerComponent(Object bean, String domain, String type,
+                                  String name)
+            throws Exception
+    {
+        StringBuffer sb=new StringBuffer();
+        sb.append( domain ).append(":");
+        sb.append( name );
+        String nameStr=sb.toString();
+        ObjectName oname=new ObjectName( nameStr );
+        registerComponent(bean, oname, type );
+    }
+
+    
+
     // should be removed
     public void unregisterComponent( String domain, String name ) {
         try {
@@ -934,4 +1002,19 @@ public class Registry implements RegistryMBean, MBeanRegistration  {
         }
     }
     
+
+    /**
+     * Load the registry from a cached .ser file. This is typically 2-3 times
+     * faster than parsing the XML.
+     *
+     * @param source Source to be used to load. Can be an InputStream or URL.
+     *
+     * @exception Exception if any parsing or processing error occurs
+     * @deprecated Loaded automatically or using a File or Url ending in .ser
+     */
+    public void loadCachedDescriptors( Object source )
+            throws Exception
+    {
+        loadDescriptors("MbeansDescriptorsSerSource", source, null );
+    }
 }
index 6429e76..f108d9f 100644 (file)
@@ -80,7 +80,7 @@ public class MbeansDescriptorsDOMSource extends ModelerSource
     }
 
     public void execute() throws Exception {
-        if( registry==null ) registry=Registry.getRegistry(null, null);
+        if( registry==null ) registry=Registry.getRegistry();
 
         try {
             InputStream stream=(InputStream)source;
index b1813ca..94ed10f 100644 (file)
@@ -77,7 +77,7 @@ public class MbeansDescriptorsIntrospectionSource extends ModelerSource
     }
 
     public void execute() throws Exception {
-        if( registry==null ) registry=Registry.getRegistry(null, null);
+        if( registry==null ) registry=Registry.getRegistry();
         try {
             ManagedBean managed = createManagedBean(registry, null,
                     (Class<?>)source, type);
index 10a73f8..53a302f 100644 (file)
@@ -70,7 +70,7 @@ public class MbeansDescriptorsSerSource extends ModelerSource
     }
 
     public void execute() throws Exception {
-        if( registry==null ) registry=Registry.getRegistry(null, null);
+        if( registry==null ) registry=Registry.getRegistry();
         long t1=System.currentTimeMillis();
         try {
             InputStream stream=null;
index c95e52d..7362006 100644 (file)
@@ -123,7 +123,7 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean
     
     public void init() throws Exception {
         if( mbeans==null) execute();
-        if( registry==null ) registry=Registry.getRegistry(null, null);
+        if( registry==null ) registry=Registry.getRegistry();
         
         registry.invoke(mbeans, "init", false);
     }
@@ -137,7 +137,7 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean
     }
 
     public void execute() throws Exception {
-        if( registry==null ) registry=Registry.getRegistry(null, null);
+        if( registry==null ) registry=Registry.getRegistry();
         try {
             InputStream stream=getInputStream();
             long t1=System.currentTimeMillis();
@@ -160,8 +160,7 @@ public class MbeansSource extends ModelerSource implements MbeansSourceMBean
                 firstMbeanN=descriptorsN;
             }
 
-            MBeanServer server =
-                Registry.getRegistry(null, null).getMBeanServer();
+            MBeanServer server = Registry.getServer();
 
             // XXX Not very clean...  Just a workaround
             if( ! loaderLoaded ) {
index 686d55f..b9096d4 100644 (file)
@@ -28,6 +28,22 @@ package org.apache.tomcat.util.net;
  */
 public interface TcpConnectionHandler {
     
+    /** Add informations about the a "controler" object
+     *  specific to the server. In tomcat it will be a
+     *  ContextManager.
+     *  @deprecated This has nothing to do with TcpHandling,
+     *  was used as a workaround
+     */
+    public void setServer(Object manager);
+
+    
+    /** Used to pass config informations to the handler.
+     *
+     *  @deprecated This has nothing to do with Tcp,
+     *    was used as a workaround.
+     */
+    public void setAttribute(String name, Object value );
+    
     /** Called before the call to processConnection.
      *  If the thread is reused, init() should be called once per thread.
      *
index e11810c..899005f 100644 (file)
@@ -525,6 +525,12 @@ public class ThreadPool  {
         currentThreadCount = toOpen;
     }
 
+    /** @deprecated */
+    void log( String s ) {
+       log.info(s);
+       //loghelper.flush();
+    }
+    
     /** 
      * Periodically execute an action - cleanup in this case
      */