Search in sources :

Example 1 with AtomicRefProxy

use of com.hazelcast.client.cp.internal.datastructures.atomicref.AtomicRefProxy in project hazelcast by hazelcast.

the class ClientRaftProxyFactory method createProxy.

@Nonnull
public <T extends DistributedObject> T createProxy(String serviceName, String proxyName) {
    proxyName = withoutDefaultGroupName(proxyName);
    String objectName = getObjectNameForProxy(proxyName);
    RaftGroupId groupId = getGroupId(proxyName, objectName);
    if (serviceName.equals(AtomicLongService.SERVICE_NAME)) {
        return (T) new AtomicLongProxy(context, groupId, proxyName, objectName);
    } else if (serviceName.equals(AtomicRefService.SERVICE_NAME)) {
        return (T) new AtomicRefProxy(context, groupId, proxyName, objectName);
    } else if (serviceName.equals(CountDownLatchService.SERVICE_NAME)) {
        return (T) new CountDownLatchProxy(context, groupId, proxyName, objectName);
    } else if (serviceName.equals(LockService.SERVICE_NAME)) {
        return (T) createFencedLock(groupId, proxyName, objectName);
    } else if (serviceName.equals(SemaphoreService.SERVICE_NAME)) {
        return (T) createSemaphore(groupId, proxyName, objectName);
    } else {
        throw new IllegalArgumentException();
    }
}
Also used : CountDownLatchProxy(com.hazelcast.client.cp.internal.datastructures.countdownlatch.CountDownLatchProxy) RaftGroupId(com.hazelcast.cp.internal.RaftGroupId) AtomicLongProxy(com.hazelcast.client.cp.internal.datastructures.atomiclong.AtomicLongProxy) AtomicRefProxy(com.hazelcast.client.cp.internal.datastructures.atomicref.AtomicRefProxy) Nonnull(javax.annotation.Nonnull)

Aggregations

AtomicLongProxy (com.hazelcast.client.cp.internal.datastructures.atomiclong.AtomicLongProxy)1 AtomicRefProxy (com.hazelcast.client.cp.internal.datastructures.atomicref.AtomicRefProxy)1 CountDownLatchProxy (com.hazelcast.client.cp.internal.datastructures.countdownlatch.CountDownLatchProxy)1 RaftGroupId (com.hazelcast.cp.internal.RaftGroupId)1 Nonnull (javax.annotation.Nonnull)1