javax.security.auth
static class: SubjectDomainCombiner.WeakKeyValueMap [javadoc |
source]
java.lang.Object
java.util.AbstractMap<K, V>
java.util.WeakHashMap<V>
javax.security.auth.SubjectDomainCombiner$WeakKeyValueMap
All Implemented Interfaces:
Map
A HashMap that has weak keys and values.
Key objects in this map are the "current" ProtectionDomain instances
received via the combine method. Each "current" PD is mapped to a
new PD instance that holds both the contents of the "current" PD,
as well as the principals from the Subject associated with this combiner.
The newly created "principal-based" PD values must be stored as
WeakReferences since they contain strong references to the
corresponding key object (the "current" non-principal-based PD),
which will prevent the key from being GC'd. Specifically,
a "principal-based" PD contains strong references to the CodeSource,
signer certs, PermissionCollection and ClassLoader objects
in the "current PD".
Method from javax.security.auth.SubjectDomainCombiner$WeakKeyValueMap Summary: |
---|
getValue, putValue |
Methods from java.util.WeakHashMap: |
---|
clear, containsKey, containsValue, entrySet, get, getEntry, isEmpty, keySet, put, putAll, remove, removeMapping, resize, size, unmaskNull, values |
Methods from java.util.AbstractMap: |
---|
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from javax.security.auth.SubjectDomainCombiner$WeakKeyValueMap Detail: |
public V getValue(K key) {
WeakReference< V > wr = super.get(key);
if (wr != null) {
return wr.get();
}
return null;
}
|
public V putValue(K key,
V value) {
WeakReference< V > wr = super.put(key, new WeakReference< V >(value));
if (wr != null) {
return wr.get();
}
return null;
}
|