public class HazelcastSemaphoreNamedLockFactory extends NamedLockFactorySupport
AdaptedSemaphoreNamedLock
instances using adapted Hazelcast ISemaphore
. This class may
use HazelcastInstance
backed by Hazelcast Server or Hazelcast Client.Modifier and Type | Field and Description |
---|---|
protected static String |
NAME_PREFIX |
logger
Constructor and Description |
---|
HazelcastSemaphoreNamedLockFactory(com.hazelcast.core.HazelcastInstance hazelcastInstance,
BiFunction<com.hazelcast.core.HazelcastInstance,String,com.hazelcast.cp.ISemaphore> semaphoreFunction,
boolean destroySemaphore,
boolean manageHazelcast) |
Modifier and Type | Method and Description |
---|---|
protected AdaptedSemaphoreNamedLock |
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.
|
void |
shutdown()
Performs a clean shut down of the factory.
|
closeLock, finalize, getLock
protected static final String NAME_PREFIX
public HazelcastSemaphoreNamedLockFactory(com.hazelcast.core.HazelcastInstance hazelcastInstance, BiFunction<com.hazelcast.core.HazelcastInstance,String,com.hazelcast.cp.ISemaphore> semaphoreFunction, boolean destroySemaphore, boolean manageHazelcast)
protected AdaptedSemaphoreNamedLock createLock(String name)
NamedLockFactorySupport
NamedLockSupport
for given name
, this method must never
return null
.createLock
in class NamedLockFactorySupport
public void shutdown()
NamedLockFactory
shutdown
in interface NamedLockFactory
shutdown
in class NamedLockFactorySupport
protected void destroyLock(String name)
NamedLockFactorySupport
destroyLock
in class NamedLockFactorySupport
Copyright © 2010–2021 The Apache Software Foundation. All rights reserved.