Package com.hazelcast.spi

Examples of com.hazelcast.spi.InvocationBuilder.invoke()


                    }
                } else {
                    if (returnsResponse) {
                        InvocationBuilder ib = os.createInvocationBuilder(SERVICE_NAME, operation, member.getAddress());

                        V response = (V) ib.invoke().getSafely();
                        if (response != null) {
                            results.add(response);
                        }
                    } else {
                        os.send(operation, member.getAddress());
View Full Code Here


                    return (V) operation.getResponse();
                }
            } else {
                if (returnsResponse) {
                    InvocationBuilder ib = os.createInvocationBuilder(SERVICE_NAME, operation, address);
                    return (V) ib.invoke().get();
                } else {
                    os.send(operation, address);
                }
            }
        } catch (Exception e) {
View Full Code Here

            op.setCallerUuid(endpoint.getUuid());
            InvocationBuilder builder = clientEngine.createInvocationBuilder(getServiceName(), op, target)
                    .setTryCount(TRY_COUNT)
                    .setResultDeserialized(false)
                    .setCallback(new SingleTargetCallback(target, callback));
            builder.invoke();
        }
    }


    protected abstract OperationFactory createOperationFactory();
View Full Code Here

                .setCallback(new Callback<Object>() {
                    public void notify(Object object) {
                        endpoint.sendResponse(filter(object), getCallId());
                    }
                });
        builder.invoke();
    }

    protected abstract Operation prepareOperation();

    public abstract Address getTarget();
View Full Code Here

        InvocationBuilder builder = clientEngine.createInvocationBuilder(getServiceName(), op, getPartition())
                .setReplicaIndex(getReplicaIndex())
                .setTryCount(TRY_COUNT)
                .setResultDeserialized(false)
                .setCallback(new CallbackImpl(endpoint));
        builder.invoke();
    }

    protected abstract Operation prepareOperation();

    protected abstract int getPartition();
View Full Code Here

            builder = opService.createInvocationBuilder(DistributedExecutorService.SERVICE_NAME, op, partitionId);
        } else {
            builder = opService.createInvocationBuilder(DistributedExecutorService.SERVICE_NAME, op, target);
        }
        builder.setTryCount(CANCEL_TRY_COUNT).setTryPauseMillis(CANCEL_TRY_PAUSE_MILLIS);
        return builder.invoke();
    }

    @Override
    public boolean isCancelled() {
        return cancelled;
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);
View Full Code Here

            op.setCallerUuid(endpoint.getUuid());
            InvocationBuilder builder = operationService.createInvocationBuilder(getServiceName(), op, target)
                    .setTryCount(TRY_COUNT)
                    .setResultDeserialized(false)
                    .setCallback(new SingleTargetCallback(target, callback));
            builder.invoke();
        }
    }


    protected abstract OperationFactory createOperationFactory();
View Full Code Here

        try {
            final OperationService operationService = nodeEngine.getOperationService();
            final InvocationBuilder invocationBuilder
                    = operationService.createInvocationBuilder(SERVICE_NAME,
                    operation, partitionId).setResultDeserialized(false);
            final InternalCompletableFuture<Data> future = invocationBuilder.invoke();
            future.andThen(new ExecutionCallback<Data>() {
                @Override
                public void onResponse(Data response) {
                    if (nearCacheEnabled) {
                        int partitionId = nodeEngine.getPartitionService().getPartitionId(key);
View Full Code Here

        for (MemberImpl member : members) {
            Address address = member.getAddress();
            if (!thisAddress.equals(address)) {
                Operation operation = new ReplicatedMapClearOperation(name, emptyReplicationQueue);
                InvocationBuilder ib = operationService.createInvocationBuilder(SERVICE_NAME, operation, address);
                futures.put(member, ib.invoke());
            }
        }
        return futures;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.