Class HazelcastSemaphoreNamedLockFactory
java.lang.Object
org.eclipse.aether.named.support.NamedLockFactorySupport
org.eclipse.aether.named.hazelcast.HazelcastSemaphoreNamedLockFactory
- All Implemented Interfaces:
NamedLockFactory
- Direct Known Subclasses:
HazelcastClientCPSemaphoreNamedLockFactory
,HazelcastCPSemaphoreNamedLockFactory
Factory of
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.-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.hazelcast.core.HazelcastInstance
protected final boolean
Fields inherited from class org.eclipse.aether.named.support.NamedLockFactorySupport
logger
-
Constructor Summary
ConstructorDescriptionHazelcastSemaphoreNamedLockFactory
(com.hazelcast.core.HazelcastInstance hazelcastInstance, boolean manageHazelcast, HazelcastSemaphoreProvider hazelcastSemaphoreProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected AdaptedSemaphoreNamedLock
createLock
(String name) Implementations shall create and returnNamedLockSupport
for givenname
, this method must never returnnull
.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.Methods inherited from class org.eclipse.aether.named.support.NamedLockFactorySupport
closeLock, finalize, getLock
-
Field Details
-
hazelcastInstance
-
manageHazelcast
-
-
Constructor Details
-
HazelcastSemaphoreNamedLockFactory
public HazelcastSemaphoreNamedLockFactory(com.hazelcast.core.HazelcastInstance hazelcastInstance, boolean manageHazelcast, HazelcastSemaphoreProvider hazelcastSemaphoreProvider)
-
-
Method Details
-
createLock
Description copied from class:NamedLockFactorySupport
Implementations shall create and returnNamedLockSupport
for givenname
, this method must never returnnull
.- Specified by:
createLock
in classNamedLockFactorySupport
-
destroyLock
Description copied from class:NamedLockFactorySupport
Implementation may override this (empty) method to perform some sort of implementation specific cleanup for given lock name. Invoked when reference count for given name drops to zero and named lock was removed.- Overrides:
destroyLock
in classNamedLockFactorySupport
-
shutdown
Description copied from interface:NamedLockFactory
Performs a clean shut down of the factory.- Specified by:
shutdown
in interfaceNamedLockFactory
- Overrides:
shutdown
in classNamedLockFactorySupport
-