com.hazelcast.core.ISemaphore Java Examples

The following examples show how to use com.hazelcast.core.ISemaphore. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GateKeeperRunnable.java    From java-11-examples with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    try {
        LOG.info("acquiring gatekeeper lock");
        ISemaphore semaphore = hazelcastInstance.getSemaphore("gatekeeper");
        semaphore.init(1);
        semaphore.acquire();
        listener.onGateKeepingEvent();
    } catch (InterruptedException e) {
        executor.execute(this);
    }
}
 
Example #2
Source File: WebConfigurerTest.java    From flair-engine with Apache License 2.0 4 votes vote down vote up
@Override
public ISemaphore getSemaphore(String s) {
    return null;
}
 
Example #3
Source File: HazelcastSemaphore.java    From hazelcast-locks with Apache License 2.0 4 votes vote down vote up
public HazelcastSemaphore(ISemaphore delegate)
{
    this.delegate = delegate;
}