remm        2003/01/29 04:42:21

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardWrapper.java
  Log:
  - Add a way to get the mappings associated with a wrapper (there was none
    which of course is a problem unless the mapper is the context itself).
  
  Revision  Changes    Path
  1.14      +53 -4     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardWrapper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- StandardWrapper.java      27 Jan 2003 23:33:10 -0000      1.13
  +++ StandardWrapper.java      29 Jan 2003 12:42:20 -0000      1.14
  @@ -66,6 +66,7 @@
   
   
   import java.io.PrintStream;
  +import java.util.ArrayList;
   import java.util.Enumeration;
   import java.util.HashMap;
   import java.util.Stack;
  @@ -187,6 +188,12 @@
   
   
       /**
  +     * Mappings associated with the wrapper.
  +     */
  +    private ArrayList mappings = new ArrayList();
  +
  +
  +    /**
        * The initialization parameters for this servlet, keyed by
        * parameter name.
        */
  @@ -620,6 +627,21 @@
   
   
       /**
  +     * Add a mapping associated with the Wrapper.
  +     * 
  +     * @param pattern The new wrapper mapping
  +     */
  +    public void addMapping(String mapping) {
  +
  +        synchronized (mappings) {
  +            mappings.add(mapping);
  +        }
  +        fireContainerEvent("addMapping", mapping);
  +
  +    }
  +
  +
  +    /**
        * Add a new security role reference record to the set of records for
        * this servlet.
        *
  @@ -776,6 +798,18 @@
   
   
       /**
  +     * Return the mappings associated with this wrapper.
  +     */
  +    public String[] findMappings() {
  +
  +        synchronized (mappings) {
  +            return (String[]) mappings.toArray(new String[mappings.size()]);
  +        }
  +
  +    }
  +
  +
  +    /**
        * Return the security role link for the specified security role
        * reference name, if any; otherwise return <code>null</code>.
        *
  @@ -1041,6 +1075,21 @@
       public void removeInstanceListener(InstanceListener listener) {
   
           instanceSupport.removeInstanceListener(listener);
  +
  +    }
  +
  +
  +    /**
  +     * Remove a mapping associated with the wrapper.
  +     *
  +     * @param mapping The pattern to remove
  +     */
  +    public void removeMapping(String mapping) {
  +
  +        synchronized (mappings) {
  +            mappings.remove(mapping);
  +        }
  +        fireContainerEvent("removeMapping", mapping);
   
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to