Package com.hazelcast.core

Examples of com.hazelcast.core.ExecutionCallback


                        predicate, mapper, combinerFactory, reducerFactory, keyValueSource,
                        chunkSize, topologyChangedStrategy);

                final ClientCompletableFuture completableFuture = new ClientCompletableFuture(jobId);
                ClientCallFuture future = (ClientCallFuture) cis.invokeOnRandomTarget(request, null);
                future.andThen(new ExecutionCallback() {
                    @Override
                    public void onResponse(Object response) {
                        try {
                            if (collator != null) {
                                response = collator.collate(((Map) response).entrySet());
View Full Code Here


        final int k = simpleTestNodeCount;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(k);
        final HazelcastInstance[] instances = factory.newInstances(new Config());
        final AtomicInteger count = new AtomicInteger(0);
        final CountDownLatch latch = new CountDownLatch(k);
        final ExecutionCallback callback = new ExecutionCallback() {
            public void onResponse(Object response) {
                if (response == null) {
                    count.incrementAndGet();
                }
                latch.countDown();
View Full Code Here

        final int k = simpleTestNodeCount;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(k);
        final HazelcastInstance[] instances = factory.newInstances(new Config());
        final AtomicInteger count = new AtomicInteger(0);
        final CountDownLatch latch = new CountDownLatch(k);
        final ExecutionCallback callback = new ExecutionCallback() {
            public void onResponse(Object response) {
                if (response == null) {
                    count.incrementAndGet();
                }
                latch.countDown();
View Full Code Here

        final int k = simpleTestNodeCount;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(k);
        final HazelcastInstance[] instances = factory.newInstances(new Config());
        final AtomicInteger count = new AtomicInteger(0);
        final CountDownLatch latch = new CountDownLatch(k / 2);
        final ExecutionCallback callback = new ExecutionCallback() {
            public void onResponse(Object response) {
                if ((Boolean) response) {
                    count.incrementAndGet();
                }
                latch.countDown();
View Full Code Here

        final int k = simpleTestNodeCount;
        TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(k);
        final HazelcastInstance[] instances = factory.newInstances(new Config());
        final AtomicInteger count = new AtomicInteger(0);
        final CountDownLatch latch = new CountDownLatch(k / 2);
        final ExecutionCallback callback = new ExecutionCallback() {
            public void onResponse(Object response) {
                if ((Boolean) response) {
                    count.incrementAndGet();
                }
                latch.countDown();
View Full Code Here

    @Test
    public void testExecutionCallback() throws Exception {
        Callable<String> task = new BasicTestTask();
        IExecutorService executor = createSingleNodeExecutorService("testExecutionCallback");
        final CountDownLatch latch = new CountDownLatch(1);
        final ExecutionCallback executionCallback = new ExecutionCallback() {
            public void onResponse(Object response) {
                latch.countDown();
            }

            public void onFailure(Throwable t) {
View Full Code Here

                }
            });

            final AtomicReference reference = new AtomicReference();
            final ICompletableFuture completableFuture = es.asCompletableFuture(future);
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference.set(response);
                    latch2.countDown();
                }
View Full Code Here

            });

            final AtomicReference reference1 = new AtomicReference();
            final AtomicReference reference2 = new AtomicReference();
            final ICompletableFuture completableFuture = es.asCompletableFuture(future);
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference1.set(response);
                    latch2.countDown();
                }

                @Override
                public void onFailure(Throwable t) {
                    reference1.set(t);
                    latch2.countDown();
                }
            });
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference2.set(response);
                    latch2.countDown();
                }
View Full Code Here

            final ICompletableFuture completableFuture = es.asCompletableFuture(future);
            latch1.await(30, TimeUnit.SECONDS);

            final AtomicReference reference = new AtomicReference();
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference.set(response);
                    latch2.countDown();
                }
View Full Code Here

            latch1.await(30, TimeUnit.SECONDS);

            final AtomicReference reference1 = new AtomicReference();
            final AtomicReference reference2 = new AtomicReference();
            final ICompletableFuture completableFuture = es.asCompletableFuture(future);
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference1.set(response);
                    latch2.countDown();
                }

                @Override
                public void onFailure(Throwable t) {
                    reference1.set(t);
                    latch2.countDown();
                }
            });
            completableFuture.andThen(new ExecutionCallback() {
                @Override
                public void onResponse(Object response) {
                    reference2.set(response);
                    latch2.countDown();
                }
View Full Code Here

TOP

Related Classes of com.hazelcast.core.ExecutionCallback

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.