|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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<K,V> |
| 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 Mappublic boolean isEmpty()
isEmpty in interface Mappublic boolean containsKey(Object key)
containsKey in interface Mapkey - the key to search for
public boolean containsValue(Object value)
containsValue in interface Mapvalue - the value to search for
public Object get(Object key)
get in interface Mapkey - the key
public Object put(Object key,
Object value)
put in interface Mapkey - the key to add, must not be nullvalue - the value to add, must not be null
public Object remove(Object key)
remove in interface Mapkey - the mapping to remove
public void clear()
clear in interface Mappublic Collection values()
values in interface Mappublic void putAll(Map t)
putAll in interface Mappublic Set entrySet()
entrySet in interface Mappublic Set keySet()
keySet in interface Map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||