Examples of InvocationBuilder


Examples of com.hazelcast.spi.InvocationBuilder

                            results.add(response);
                        }
                    }
                } 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

Examples of com.hazelcast.spi.InvocationBuilder

                if (returnsResponse) {
                    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

Examples of com.hazelcast.spi.InvocationBuilder

        MultiTargetCallback callback = new MultiTargetCallback(targets);
        for (Address target : targets) {
            Operation op = operationFactory.createOperation();
            op.setCallerUuid(endpoint.getUuid());
            InvocationBuilder builder = clientEngine.createInvocationBuilder(getServiceName(), op, target)
                    .setTryCount(TRY_COUNT)
                    .setResultDeserialized(false)
                    .setCallback(new SingleTargetCallback(target, callback));
            builder.invoke();
        }
    }
View Full Code Here

Examples of com.hazelcast.spi.InvocationBuilder

    public <R> R processRequest(Address address, ProcessingOperation processingOperation, String name)
            throws ExecutionException, InterruptedException {

        String executorName = MapReduceUtil.buildExecutorName(name);
        InvocationBuilder invocation = nodeEngine.getOperationService()
                                                 .createInvocationBuilder(SERVICE_NAME, processingOperation, address);

        Future<R> future = invocation.setExecutorName(executorName).invoke();
        return future.get();
    }
View Full Code Here

Examples of com.hazelcast.spi.InvocationBuilder

    @Override
    final void process() throws Exception {
        final ClientEndpoint endpoint = getEndpoint();
        final Operation op = prepareOperation();
        op.setCallerUuid(endpoint.getUuid());
        final InvocationBuilder builder = clientEngine.createInvocationBuilder(getServiceName(), op, getTarget())
                .setTryCount(TRY_COUNT)
                .setResultDeserialized(false)
                .setCallback(new Callback<Object>() {
                    public void notify(Object object) {
                        endpoint.sendResponse(filter(object), getCallId());
                    }
                });
        builder.invoke();
    }
View Full Code Here

Examples of com.hazelcast.spi.InvocationBuilder

    final void process() {
        beforeProcess();
        ClientEndpoint endpoint = getEndpoint();
        Operation op = prepareOperation();
        op.setCallerUuid(endpoint.getUuid());
        InvocationBuilder builder = clientEngine.createInvocationBuilder(getServiceName(), op, getPartition())
                .setReplicaIndex(getReplicaIndex())
                .setTryCount(TRY_COUNT)
                .setResultDeserialized(false)
                .setCallback(new CallbackImpl(endpoint));
        builder.invoke();
    }
View Full Code Here

Examples of com.hazelcast.spi.InvocationBuilder

    }

    private Future invokeCancelOperation(boolean mayInterruptIfRunning) {
        CancellationOperation op = new CancellationOperation(uuid, mayInterruptIfRunning);
        OperationService opService = nodeEngine.getOperationService();
        InvocationBuilder builder;
        if (partitionId > -1) {
            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();
    }
View Full Code Here

Examples of com.hazelcast.spi.InvocationBuilder

    }

    @Override
    protected void invoke() {
        CancellationOperation op = new CancellationOperation(uuid, interrupt);
        InvocationBuilder builder;
        if (target != null) {
            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

Examples of org.mockito.internal.invocation.InvocationBuilder

public class ReporterTest extends TestBase {

    @Test(expected=TooLittleActualInvocations.class)
    public void shouldLetPassingNullLastActualStackTrace() throws Exception {
        new Reporter().tooLittleActualInvocations(new org.mockito.internal.reporting.Discrepancy(1, 2), new InvocationBuilder().toInvocation(), null);
    }
View Full Code Here

Examples of org.mockito.internal.invocation.InvocationBuilder

    }
   
    @Test
    public void shouldCreateSerializableMethodIfIsSerializableMock() throws Exception {
        MethodInterceptorFilter filter = new MethodInterceptorFilter(handler, (MockSettingsImpl) withSettings().serializable());
        Method method = new InvocationBuilder().toInvocation().getMethod();
       
        // when
        MockitoMethod mockitoMethod = filter.createMockitoMethod(method);
       
        // then
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.