public abstract class NamedLockFactorySupport extends Object implements NamedLockFactory
NamedLockFactory
implementations providing reference counting.Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
NamedLockFactorySupport() |
Modifier and Type | Method and Description |
---|---|
void |
closeLock(String name) |
protected abstract NamedLockSupport |
createLock(String name)
Implementations shall create and return
NamedLockSupport for given name , this method must never
return null . |
protected void |
destroyLock(String name)
Implementation may override this (empty) method to perform some sort of implementation specific cleanup for
given lock name.
|
protected void |
finalize() |
NamedLockSupport |
getLock(String name)
Creates or reuses existing
NamedLock . |
void |
shutdown()
Performs a clean shut down of the factory.
|
protected final org.slf4j.Logger logger
public NamedLockFactorySupport()
public NamedLockSupport getLock(String name)
NamedLockFactory
NamedLock
. Returns instance MUST BE treated as "resource", best in
try-with-resource block.getLock
in interface NamedLockFactory
name
- the lock name, must not be null
.null
.public void shutdown()
NamedLockFactory
shutdown
in interface NamedLockFactory
protected abstract NamedLockSupport createLock(String name)
NamedLockSupport
for given name
, this method must never
return null
.protected void destroyLock(String name)
Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.