B - a bound for the types of values in the mappublic class LockableClassToInstanceMultiMap<B> extends ClassToInstanceMultiMap<B>
ClassToInstanceMultiMap which exposes a map-specific
instance of ReadWriteLock.
Callers of the map are generally responsible for explicitly locking and unlocking for reading and writing, based on application use cases and concurrency requirements. For simple single-statement atomic operations, convenience methods are supplied which execute the corresponding superclass operation under the read or write lock, as appropriate.
| Modifier and Type | Field and Description |
|---|---|
private ReadWriteLock |
readWriteLock
The map's read write lock.
|
| Constructor and Description |
|---|
LockableClassToInstanceMultiMap()
Constructor.
|
LockableClassToInstanceMultiMap(boolean isIndexingSupertypes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearWithLock()
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
boolean |
containsKeyWithLock(Class<?> key)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
boolean |
containsValueWithLock(B value)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
ReadWriteLock |
getReadWriteLock()
Get the map-specific instance of the
ReadWriteLock. |
<T> List<T> |
getWithLock(Class<T> type)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
boolean |
isEmptyWithLock()
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
Set<Class<?>> |
keysWithLock()
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
void |
putAllWithLock(ClassToInstanceMultiMap<? extends B> map)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
putAllWithLock(Iterable<? extends B> newValues)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
putWithLock(B value)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
removeAllWithLock(ClassToInstanceMultiMap<? extends B> map)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
removeAllWithLock(Iterable<? extends B> removeValues)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
removeWithLock(B value)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
void |
removeWithLock(Class<?> type)
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a write lock. |
Collection<? extends B> |
valuesWithLock()
Convenience method which executes the like-named method from superclass
ClassToInstanceMultiMap
under a read lock. |
@Nonnull private final ReadWriteLock readWriteLock
public LockableClassToInstanceMultiMap()
public LockableClassToInstanceMultiMap(boolean isIndexingSupertypes)
isIndexingSupertypes - indicates whether supertypes of a value should be indexed@Nonnull public ReadWriteLock getReadWriteLock()
ReadWriteLock.
Callers of the map are responsible for explicitly locking (and unlocking) for reading and/or writing, based on application use cases.
public void clearWithLock()
ClassToInstanceMultiMap
under a write lock.public boolean containsKeyWithLock(@Nullable Class<?> key)
ClassToInstanceMultiMap
under a read lock.key - key to check for in the mappublic boolean containsValueWithLock(@Nonnull B value)
ClassToInstanceMultiMap
under a read lock.value - value to check for in this map@Nonnull @NonnullElements @Unmodifiable @Live public <T> List<T> getWithLock(@Nullable Class<T> type)
ClassToInstanceMultiMap
under a read lock.T - type identifiertype - map keypublic boolean isEmptyWithLock()
ClassToInstanceMultiMap
under a read lock.@Nonnull @NonnullElements @Unmodifiable @Live public Set<Class<?>> keysWithLock()
ClassToInstanceMultiMap
under a read lock.public void putWithLock(@Nonnull B value)
ClassToInstanceMultiMap
under a write lock.value - value to be stored in the mappublic void putAllWithLock(@Nullable@NonnullElements ClassToInstanceMultiMap<? extends B> map)
ClassToInstanceMultiMap
under a write lock.map - map containing values to be addedpublic void putAllWithLock(@Nullable@NonnullElements Iterable<? extends B> newValues)
ClassToInstanceMultiMap
under a write lock.newValues - values to be addedpublic void removeWithLock(@Nonnull B value)
ClassToInstanceMultiMap
under a write lock.value - the value to removepublic void removeWithLock(@Nullable Class<?> type)
ClassToInstanceMultiMap
under a write lock.type - the type of values to removepublic void removeAllWithLock(@Nullable@NonnullElements ClassToInstanceMultiMap<? extends B> map)
ClassToInstanceMultiMap
under a write lock.map - the map containing the values to removepublic void removeAllWithLock(@Nullable@NonnullElements Iterable<? extends B> removeValues)
ClassToInstanceMultiMap
under a write lock.removeValues - the values to remove@Nonnull @NonnullElements @Unmodifiable @Live public Collection<? extends B> valuesWithLock()
ClassToInstanceMultiMap
under a read lock.Copyright © 1999–2019 Shibboleth Consortium. All rights reserved.