public class HazelcastSemaphoreNamedLockFactory extends NamedLockFactorySupport
AdaptedSemaphoreNamedLock
instances, using adapted Hazelcast ISemaphore
. It delegates
most the work to HazelcastSemaphoreProvider
and this class just adapts the returned semaphore to named lock
and caches ISemaphore
instances, as recommended by Hazelcast.Modifier and Type | Field and Description |
---|---|
protected com.hazelcast.core.HazelcastInstance |
hazelcastInstance |
protected boolean |
manageHazelcast |
logger
Constructor and Description |
---|
HazelcastSemaphoreNamedLockFactory(com.hazelcast.core.HazelcastInstance hazelcastInstance,
boolean manageHazelcast,
HazelcastSemaphoreProvider hazelcastSemaphoreProvider) |
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 final com.hazelcast.core.HazelcastInstance hazelcastInstance
protected final boolean manageHazelcast
public HazelcastSemaphoreNamedLockFactory(com.hazelcast.core.HazelcastInstance hazelcastInstance, boolean manageHazelcast, HazelcastSemaphoreProvider hazelcastSemaphoreProvider)
protected AdaptedSemaphoreNamedLock createLock(String name)
NamedLockFactorySupport
NamedLockSupport
for given name
, this method must never
return null
.createLock
in class NamedLockFactorySupport
protected void destroyLock(String name)
NamedLockFactorySupport
destroyLock
in class NamedLockFactorySupport
public void shutdown()
NamedLockFactory
shutdown
in interface NamedLockFactory
shutdown
in class NamedLockFactorySupport
Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.