Package com.hazelcast.spi

Examples of com.hazelcast.spi.InternalCompletableFuture


        String uuid = buildRandomUuidString();
        Address target = ((MemberImpl) member).getAddress();

        boolean sync = checkSync();
        MemberCallableTaskOperation op = new MemberCallableTaskOperation(name, uuid, task);
        InternalCompletableFuture future = nodeEngine.getOperationService().invokeOnTarget(
                DistributedExecutorService.SERVICE_NAME, op, target);
        if (sync) {
            Object response;
            try {
                response = future.get();
            } catch (Exception e) {
                response = e;
            }
            return new CompletedFuture<T>(nodeEngine.getSerializationService(), response, getAsyncExecutor());
        }
View Full Code Here


    }

    @Override
    public void countDown() {
        CountDownOperation op = new CountDownOperation(name);
        InternalCompletableFuture f = invoke(op);
        f.getSafely();
    }
View Full Code Here

            builder = createInvocationBuilder(getServiceName(), op, target);
        } else {
            builder = createInvocationBuilder(getServiceName(), op, partitionId);
        }
        builder.setTryCount(CANCEL_TRY_COUNT).setTryPauseMillis(CANCEL_TRY_PAUSE_MILLIS);
        InternalCompletableFuture future = builder.invoke();
        boolean result = false;
        try {
            result = (Boolean) future.get();
        } catch (InterruptedException e) {
            logException(e);
        } catch (ExecutionException e) {
            logException(e);
        }
View Full Code Here

    @Override
    public void publish(Object message) {
        NodeEngine nodeEngine = getNodeEngine();
        PublishOperation operation = new PublishOperation(getName(), nodeEngine.toData(message));
        InternalCompletableFuture f = operationService.invokeOnPartition(TopicService.SERVICE_NAME, operation, partitionId);
        f.getSafely();
    }
View Full Code Here

    @Override
    public void release(int permits) {
        isNotNegative(permits, "permits");
        ReleaseOperation operation = new ReleaseOperation(name, permits);
        InternalCompletableFuture future = invoke(operation);
        future.getSafely();
    }
View Full Code Here

    }

    private void beforeAwait(long threadId) {
        Data key = lockProxy.getKeyData();
        BeforeAwaitOperation op = new BeforeAwaitOperation(namespace, key, threadId, conditionId);
        InternalCompletableFuture f = invoke(op);
        f.getSafely();
    }
View Full Code Here

    private void signal(boolean all) {
        long threadId = ThreadUtil.getThreadId();
        Data key = lockProxy.getKeyData();
        SignalOperation op = new SignalOperation(namespace, key, threadId, conditionId, all);
        InternalCompletableFuture f = invoke(op);
        f.getSafely();
    }
View Full Code Here

        String uuid = buildRandomUuidString();
        Address target = ((MemberImpl) member).getAddress();

        boolean sync = checkSync();
        MemberCallableTaskOperation op = new MemberCallableTaskOperation(name, uuid, task);
        InternalCompletableFuture future = nodeEngine.getOperationService()
                .invokeOnTarget(DistributedExecutorService.SERVICE_NAME, op, target);
        if (sync) {
            Object response;
            try {
                response = future.get();
            } catch (Exception e) {
                response = e;
            }
            return new CompletedFuture<T>(nodeEngine.getSerializationService(), response, getAsyncExecutor());
        }
View Full Code Here

    @Override
    public void publish(Object message) {
        NodeEngine nodeEngine = getNodeEngine();
        PublishOperation operation = new PublishOperation(getName(), nodeEngine.toData(message));
        InternalCompletableFuture f = operationService.invokeOnPartition(TopicService.SERVICE_NAME, operation, partitionId);
        f.getSafely();
    }
View Full Code Here

        isClosed.set(true);

        Operation operation = new CacheDestroyOperation(cacheConfig.getNameWithPrefix());
        int partitionId = getNodeEngine().getPartitionService().getPartitionId(getDistributedObjectName());
        OperationService operationService = getNodeEngine().getOperationService();
        InternalCompletableFuture f = operationService.invokeOnPartition(CacheService.SERVICE_NAME, operation, partitionId);
        //todo What happens in exception case? Cache doesn't get destroyed
        f.getSafely();

        cacheService.destroyCache(getDistributedObjectName(), true, null);
        f.getSafely();
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.spi.InternalCompletableFuture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.