org.apache.axis.utils

Class LockableHashtable


public class LockableHashtable
extends Hashtable

This subclass of the java Hashtable allows individual entries to be "locked" so that their values cannot be overwritten or removed. Note, only the put() and remove() methods have been overridden. The clear() method still removes all entries whether they've been locked or not.

Author:
James Snell (jasnell@us.ibm.com)

Constructor Summary

LockableHashtable()
LockableHashtable(int p1)
LockableHashtable(int p1, float p2)
LockableHashtable(java.util.Map p1)

Method Summary

Object
get(Object key)
Get an entry from this hashtable, and if we don't find anything, defer to our parent, if any.
Set
getAllKeys()
Returns the keys in this hashtable, and its parent chain
Hashtable
getParent()
Gets the parent Hashtable for this object (if any)
boolean
isKeyLocked(Object key)
Returns true if a given key is in our locked list
Object
put(Object p1, Object p2)
Overrides the Hashtable.put() method to mark items as not being locked.
Object
put(Object p1, Object p2, boolean locked)
New version of the put() method that allows for explicitly marking items added to the hashtable as locked.
Object
remove(Object p1)
Checks to see if an item is locked before it is removed.
void
setParent(Hashtable parent)
Set the parent Hashtable for this object

Constructor Details

LockableHashtable

public LockableHashtable()


LockableHashtable

public LockableHashtable(int p1)


LockableHashtable

public LockableHashtable(int p1,
                         float p2)


LockableHashtable

public LockableHashtable(java.util.Map p1)

Method Details

get

public Object get(Object key)
Get an entry from this hashtable, and if we don't find anything, defer to our parent, if any.


getAllKeys

public Set getAllKeys()
Returns the keys in this hashtable, and its parent chain


getParent

public Hashtable getParent()
Gets the parent Hashtable for this object (if any)


isKeyLocked

public boolean isKeyLocked(Object key)
Returns true if a given key is in our locked list


put

public Object put(Object p1,
                  Object p2)
Overrides the Hashtable.put() method to mark items as not being locked.


put

public Object put(Object p1,
                  Object p2,
                  boolean locked)
New version of the put() method that allows for explicitly marking items added to the hashtable as locked.


remove

public Object remove(Object p1)
Checks to see if an item is locked before it is removed.


setParent

public void setParent(Hashtable parent)
Set the parent Hashtable for this object


Copyright B) 2005 Apache Web Services Project. All Rights Reserved.