|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.kernel.basic.BasicProxyMap
public class BasicProxyMap
Streamlined version of a WeakIdentityHashMap. Provides Identity semantics with
Weak References to keys. This allows proxies to be GC'ed when no longer referenced
by clients. BasicProxymanager.destroyProxy()
need not be invoked when a
proxy is no longer needed. Note that this is not a full Map implementation.
The iteration and collection capabilities of Map have been discarded to keep the
implementation lightweight.
Much of this code was cribbed from the Commons Collection 3.1 implementation of
ReferenceIdentityMap
and AbstractReferenceMap
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry |
Constructor Summary | |
---|---|
BasicProxyMap()
|
Method Summary | |
---|---|
void |
clear()
Clears the map, resetting the size to zero and nullifying references to avoid garbage collection issues. |
boolean |
containsKey(Object key)
Checks whether the map contains the specified key. |
boolean |
containsValue(Object value)
Checks whether the map contains the specified value. |
Set |
entrySet()
|
Object |
get(Object key)
Gets the value mapped to the key specified. |
boolean |
isEmpty()
Checks whether the map is currently empty. |
Set |
keySet()
|
Object |
put(Object key,
Object value)
Puts a key-value entry into this map. |
void |
putAll(Map t)
|
Object |
remove(Object key)
Removes the specified mapping from this map. |
int |
size()
Gets the size of the map. |
Collection |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public BasicProxyMap()
Method Detail |
---|
public int size()
size
in interface Map
public boolean isEmpty()
isEmpty
in interface Map
public boolean containsKey(Object key)
containsKey
in interface Map
key
- the key to search for
public boolean containsValue(Object value)
containsValue
in interface Map
value
- the value to search for
public Object get(Object key)
get
in interface Map
key
- the key
public Object put(Object key, Object value)
put
in interface Map
key
- the key to add, must not be nullvalue
- the value to add, must not be null
public Object remove(Object key)
remove
in interface Map
key
- the mapping to remove
public void clear()
clear
in interface Map
public Collection values()
values
in interface Map
public void putAll(Map t)
putAll
in interface Map
public Set entrySet()
entrySet
in interface Map
public Set keySet()
keySet
in interface Map
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |