@Override public CompletableFuture<AsyncAtomicCounterMap<String>> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenApply(v -> this); }
@Override public CompletableFuture<Void> delete() { executor.shutdown(); timer.cancel(); return super.delete(); }
@Override public CompletableFuture<Void> delete() { return client.delete().thenCompose(v -> registry.deletePrimitive(name())); }
@Override public CompletableFuture<AsyncAtomicLock> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenApply(v -> this); }
@Override public CompletableFuture<Void> delete() { executor.shutdown(); timer.cancel(); return super.delete(); }
@Override public CompletableFuture<AsyncAtomicCounter> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenApply(v -> this); }
@Override public CompletableFuture<AsyncAtomicSemaphore> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenApply(v -> this); }
@Override public CompletableFuture<AsyncAtomicValue<byte[]>> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenApply(v -> this); }
@Override public CompletableFuture<P> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenRun(() -> getProxyClient().getPartitions().forEach(partition -> { partition.addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { partition.accept(service -> service.listen()); } }); })) .thenApply(v -> (P) this); }
@Override public CompletableFuture<AsyncLeaderElector<byte[]>> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenRun(() -> getProxyClient().getPartitions().forEach(partition -> { partition.addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { partition.accept(service -> service.listen()); } }); })) .thenApply(v -> this); }
@Override public CompletableFuture<AsyncDistributedCyclicBarrier> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenCompose(v -> getProxyClient().acceptBy(name(), service -> service.join())) .thenApply(v -> this); }
@Override public CompletableFuture<A> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenRun(() -> getProxyClient().getPartitions().forEach(partition -> { partition.addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { partition.accept(service -> service.listen()); } }); })) .thenApply(v -> (A) this); } }
@Override public CompletableFuture<AsyncAtomicMultimap<String, byte[]>> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenRun(() -> getProxyClient().getPartitionIds().forEach(partition -> { getProxyClient().getPartition(partition).addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { getProxyClient().acceptOn(partition, service -> service.listen()); } }); })) .thenApply(v -> this); }
@Override public CompletableFuture<AsyncLeaderElection<byte[]>> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenRun(() -> getProxyClient().getPartitions().forEach(partition -> { partition.addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { partition.accept(service -> service.listen()); } }); })) .thenApply(v -> this); }
@Override public CompletableFuture<AsyncWorkQueue<byte[]>> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenRun(() -> getProxyClient().getPartition(name()).addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isRegistered.get()) { getProxyClient().acceptBy(name(), service -> service.register()); } })) .thenApply(v -> this); }
@Override public CompletableFuture<A> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenRun(() -> { ProxySession<S> partition = getProxyClient().getPartition(name()); partition.addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { partition.accept(service -> service.listen()); } }); }) .thenApply(v -> (A) this); } }
@Override public CompletableFuture<P> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenRun(() -> getProxyClient().getPartition(name()).addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { getProxyClient().getPartition(name()).accept(service -> service.listen()); } })) .thenApply(v -> (P) this); }
@Override public CompletableFuture<AsyncAtomicDocumentTree<byte[]>> connect() { return super.connect() .thenCompose(v -> getProxyClient().getPartition(name()).connect()) .thenRun(() -> getProxyClient().getPartition(name()).addStateChangeListener(state -> { if (state == PrimitiveState.CONNECTED && isListening()) { getProxyClient().acceptBy(name(), service -> service.listen(root())); } })).thenApply(v -> this); }
@Override public CompletableFuture<AsyncAtomicCounterMap<String>> connect() { return super.connect() .thenCompose(v -> Futures.allOf(getProxyClient().getPartitions().stream().map(ProxySession::connect))) .thenApply(v -> this); }