Package com.hazelcast.client.executor.tasks

Examples of com.hazelcast.client.executor.tasks.AppendCallable


    @Test
    public void testSubmitCallable_withMemberSelector() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);
        MemberSelector selectAll = new SelectAllMembers();

        Future<String> f = service.submit(callable, selectAll);

        assertEquals(msg + AppendCallable.APPENDAGE, f.get());
View Full Code Here


    @Test
    public void submitCallableToAllMembers() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);

        Map<Member, Future<String>> map = service.submitToAllMembers(callable);
        for (Member member : map.keySet()) {
            Future<String> result = map.get(member);
            assertEquals(msg + AppendCallable.APPENDAGE, result.get());
View Full Code Here

        IExecutorService service = client.getExecutorService(randomString());

        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(CLUSTER_SIZE);
        final String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);
        Collection<Member> collection = server.getCluster().getMembers();

        service.submitToMembers(callable, collection, new MultiExecutionCallback() {
            public void onResponse(Member member, Object value) {
                if (value.equals(msg + AppendCallable.APPENDAGE)) {
View Full Code Here

    public void submitCallable_withExecutionCallback() {
        IExecutorService service = client.getExecutorService(randomString());

        final CountDownLatch responseLatch = new CountDownLatch(1);
        String msg = randomString();
        Callable runnable = new AppendCallable(msg);
        MemberSelector selector = new SelectAllMembers();
        final AtomicReference<Object> result = new AtomicReference<Object>();

        service.submit(runnable, selector, new ExecutionCallback() {
            public void onResponse(Object response) {
View Full Code Here

        IExecutorService service = client.getExecutorService(randomString());

        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(1);
        final String msg = randomString();
        Callable callable = new AppendCallable(msg);
        MemberSelector selector = new SelectAllMembers();

        service.submitToMembers(callable, selector, new MultiExecutionCallback() {
            public void onResponse(Member member, Object value) {
                if (value.equals(msg + AppendCallable.APPENDAGE)) {
View Full Code Here

        IExecutorService service = client.getExecutorService(randomString());

        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(CLUSTER_SIZE);
        final String msg = randomString();
        Callable callable = new AppendCallable(msg);

        service.submitToAllMembers(callable, new MultiExecutionCallback() {
            public void onResponse(Member member, Object value) {
                if (value.equals(msg + AppendCallable.APPENDAGE)) {
                    responseLatch.countDown();
View Full Code Here

    @Test
    public void testSubmitCallable() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable callable = new AppendCallable(msg);
        Future result = service.submit(callable);

        assertEquals(msg + AppendCallable.APPENDAGE, result.get());
    }
View Full Code Here

    @Test
    public void testSubmitCallable_withExecutionCallback() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);
        final AtomicReference<String> result = new AtomicReference<String>();
        final CountDownLatch responseLatch = new CountDownLatch(1);

        service.submit(callable, new ExecutionCallback<String>() {
            public void onResponse(String response) {
View Full Code Here

    @Test
    public void submitCallableToKeyOwner() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);

        Future<String> result = service.submitToKeyOwner(callable, "key");

        assertEquals(msg + AppendCallable.APPENDAGE, result.get());
    }
View Full Code Here

    @Test
    public void submitCallableToKeyOwner_withExecutionCallback() throws Exception {
        IExecutorService service = client.getExecutorService(randomString());

        String msg = randomString();
        Callable<String> callable = new AppendCallable(msg);
        final CountDownLatch responseLatch = new CountDownLatch(1);
        final AtomicReference<String> result = new AtomicReference<String>();

        service.submitToKeyOwner(callable, "key", new ExecutionCallback<String>() {
            public void onResponse(String response) {
View Full Code Here

TOP

Related Classes of com.hazelcast.client.executor.tasks.AppendCallable

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.