com.hazelcast.core
Interface SemaphoreFactory


public interface SemaphoreFactory

Hazelcast distributed semaphore helper class can be used to dynamically interact with certain semaphore events. You can override the helper methods for the desired usage.

Semaphore sample config: 1 com.domain.MySemaphoreHelper


Method Summary
 int getInitialPermits(String name, int configValue)
          Gets the initial permit value of a given named semaphore.
 

Method Detail

getInitialPermits

int getInitialPermits(String name,
                      int configValue)
Gets the initial permit value of a given named semaphore.

Implementation can get the initial permits value using any means; such as a formula, querying the cluster, an O/R mapping tool, simple SQL, reading from a file, etc.

Parameters:
name -
Returns:
number of initial permits


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.