Search in sources :

Example 1 with SessionlessSemaphoreProxy

use of com.hazelcast.cp.internal.datastructures.semaphore.proxy.SessionlessSemaphoreProxy in project hazelcast by hazelcast.

the class SemaphoreService method createProxy.

@Override
public ISemaphore createProxy(String proxyName) {
    try {
        proxyName = withoutDefaultGroupName(proxyName);
        RaftGroupId groupId = raftService.createRaftGroupForProxy(proxyName);
        String objectName = getObjectNameForProxy(proxyName);
        SemaphoreConfig config = getConfig(proxyName);
        return config != null && config.isJDKCompatible() ? new SessionlessSemaphoreProxy(nodeEngine, groupId, proxyName, objectName) : new SessionAwareSemaphoreProxy(nodeEngine, groupId, proxyName, objectName);
    } catch (Exception e) {
        throw rethrow(e);
    }
}
Also used : SessionlessSemaphoreProxy(com.hazelcast.cp.internal.datastructures.semaphore.proxy.SessionlessSemaphoreProxy) RaftGroupId(com.hazelcast.cp.internal.RaftGroupId) SemaphoreConfig(com.hazelcast.config.cp.SemaphoreConfig) SessionAwareSemaphoreProxy(com.hazelcast.cp.internal.datastructures.semaphore.proxy.SessionAwareSemaphoreProxy) WaitKeyCancelledException(com.hazelcast.cp.internal.datastructures.exception.WaitKeyCancelledException)

Aggregations

SemaphoreConfig (com.hazelcast.config.cp.SemaphoreConfig)1 RaftGroupId (com.hazelcast.cp.internal.RaftGroupId)1 WaitKeyCancelledException (com.hazelcast.cp.internal.datastructures.exception.WaitKeyCancelledException)1 SessionAwareSemaphoreProxy (com.hazelcast.cp.internal.datastructures.semaphore.proxy.SessionAwareSemaphoreProxy)1 SessionlessSemaphoreProxy (com.hazelcast.cp.internal.datastructures.semaphore.proxy.SessionlessSemaphoreProxy)1