axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: ws-axis/java/src/org/apache/axis MessageContext.java
Date Tue, 25 Nov 2003 23:13:50 GMT
dims        2003/11/25 15:13:50

  Modified:    java/src/org/apache/axis/utils LockableHashtable.java
               java/src/org/apache/axis MessageContext.java
  Log:
  Fix for  Bug 23072 - MessageContext getPropertyNames is broken
  from arh14@cornell.edu (Aaron Hamid)
  
  Revision  Changes    Path
  1.10      +27 -0     ws-axis/java/src/org/apache/axis/utils/LockableHashtable.java
  
  Index: LockableHashtable.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/utils/LockableHashtable.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LockableHashtable.java	27 Jun 2003 18:27:35 -0000	1.9
  +++ LockableHashtable.java	25 Nov 2003 23:13:50 -0000	1.10
  @@ -56,6 +56,8 @@
   
   import java.util.Hashtable;
   import java.util.Vector;
  +import java.util.Set;
  +import java.util.HashSet;
   
   /**
    * This subclass of the java Hashtable allows individual 
  @@ -100,6 +102,31 @@
       public synchronized void setParent(Hashtable parent)
       {
           this.parent = parent;
  +    }
  +
  +    /**
  +     * Gets the parent Hashtable for this object (if any)
  +     */
  +    public synchronized Hashtable getParent() {
  +      return parent;
  +    }
  +
  +    /**
  +     * Returns the keys in this hashtable, and its parent chain
  +     */
  +    public Set getAllKeys() {
  +        HashSet set = new HashSet();
  +        set.addAll(super.keySet());
  +        Hashtable p = parent;
  +        while (p != null) {
  +            set.addAll(p.keySet());
  +            if (p instanceof LockableHashtable) {
  +                p = ((LockableHashtable) p).getParent();
  +            } else {
  +                p = null;
  +            }
  +        }
  +        return set;
       }
   
       /**
  
  
  
  1.138     +9 -0      ws-axis/java/src/org/apache/axis/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -r1.137 -r1.138
  --- MessageContext.java	27 Oct 2003 19:56:19 -0000	1.137
  +++ MessageContext.java	25 Nov 2003 23:13:50 -0000	1.138
  @@ -952,6 +952,15 @@
       }
   
       /**
  +     *  Returns an Iterator view of the names of the properties 
  +     *  in this MessageContext and any parents of the LockableHashtable
  +     *  @return Iterator for the property names
  +     */
  +    public java.util.Iterator getAllPropertyNames() {
  +        return bag.getAllKeys().iterator();
  +    }
  +
  +    /**
        * Returns the value associated with the named property - or null if not
        * defined/set.
        *
  
  
  

Mime
View raw message