Class DirectHazelcastSemaphoreProvider
java.lang.Object
org.eclipse.aether.named.hazelcast.HazelcastSemaphoreProvider
org.eclipse.aether.named.hazelcast.DirectHazelcastSemaphoreProvider
Direct provider of
ISemaphore
instances: it simply uses the passed in lock name to create semaphore name out
of it. This implies, that as many lock names are requested from it, this class will create as many semaphores in
Hazelcast.-
Field Summary
Fields inherited from class org.eclipse.aether.named.hazelcast.HazelcastSemaphoreProvider
NAME_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.hazelcast.cp.ISemaphore
acquireSemaphore
(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name) Invoked when new instance of semaphore needed for given name.void
releaseSemaphore
(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name, com.hazelcast.cp.ISemaphore semaphore) Invoked when passed in semaphore associated with passed in name is not to be used anymore.
-
Constructor Details
-
DirectHazelcastSemaphoreProvider
public DirectHazelcastSemaphoreProvider()
-
-
Method Details
-
acquireSemaphore
public com.hazelcast.cp.ISemaphore acquireSemaphore(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name) Description copied from class:HazelcastSemaphoreProvider
Invoked when new instance of semaphore needed for given name. must not returnnull
.- Specified by:
acquireSemaphore
in classHazelcastSemaphoreProvider
-
releaseSemaphore
public void releaseSemaphore(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name, com.hazelcast.cp.ISemaphore semaphore) Description copied from class:HazelcastSemaphoreProvider
Invoked when passed in semaphore associated with passed in name is not to be used anymore.- Specified by:
releaseSemaphore
in classHazelcastSemaphoreProvider
-