public class DirectHazelcastSemaphoreProvider extends HazelcastSemaphoreProvider
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.NAME_PREFIX
Constructor and Description |
---|
DirectHazelcastSemaphoreProvider() |
Modifier and Type | Method and Description |
---|---|
com.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.
|
public DirectHazelcastSemaphoreProvider()
public com.hazelcast.cp.ISemaphore acquireSemaphore(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name)
HazelcastSemaphoreProvider
null
.acquireSemaphore
in class HazelcastSemaphoreProvider
public void releaseSemaphore(com.hazelcast.core.HazelcastInstance hazelcastInstance, String name, com.hazelcast.cp.ISemaphore semaphore)
HazelcastSemaphoreProvider
releaseSemaphore
in class HazelcastSemaphoreProvider
Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.