L
- the class of the lockpublic abstract class AbstractWeakKeyBasedLockFactory<L> extends Object implements KeyBasedLockFactory<L>
KeyBasedLockFactory
that uses a WeakHashMap
to store the locks. When
code using a lock is done, and there are no more references to the lock, the lock is automatically removed from
the map.Modifier | Constructor and Description |
---|---|
protected |
AbstractWeakKeyBasedLockFactory() |
Modifier and Type | Method and Description |
---|---|
L |
getLock(Object key)
Returns a lock for the specified key.
|
protected abstract L |
newLock() |
public L getLock(Object key)
KeyBasedLockFactory
getLock
in interface KeyBasedLockFactory<L>
key
- the key associated with the lockprotected abstract L newLock()
Copyright © 2023 CrafterCMS. All rights reserved.