Package com.hazelcast.client.executor.tasks

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


    @Test
    public void submitRunnableToMember_withExecutionCallback() {
        IExecutorService service = client.getExecutorService(randomString());

        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        Member member = server.getCluster().getLocalMember();
        final CountDownLatch responseLatch = new CountDownLatch(1);

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


    @Test
    public void submitRunnableToMembers_withMultiExecutionCallback() {
        IExecutorService service = client.getExecutorService(randomString());

        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        Collection<Member> collection = server.getCluster().getMembers();
        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(1);

        service.submitToMembers(runnable, collection, new MultiExecutionCallback() {
View Full Code Here

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

        final CountDownLatch responseLatch = new CountDownLatch(1);
        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        MemberSelector selector = new SelectAllMembers();

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

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

        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(1);
        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        MemberSelector selector = new SelectAllMembers();

        service.submitToMembers(runnable, selector, new MultiExecutionCallback() {
            public void onResponse(Member member, Object value) {
                responseLatch.countDown();
View Full Code Here

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

        final CountDownLatch responseLatch = new CountDownLatch(CLUSTER_SIZE);
        final CountDownLatch completeLatch = new CountDownLatch(1);
        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);

        service.submitToAllMembers(runnable, new MultiExecutionCallback() {
            public void onResponse(Member member, Object value) {
                responseLatch.countDown();
            }
View Full Code Here

    @Test
    public void submitRunnable() {
        IExecutorService service = client.getExecutorService(randomString());

        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);

        service.submit(runnable);

        IMap map = client.getMap(mapName);
View Full Code Here

    public void testSubmitRunnable_WithResult() throws ExecutionException, InterruptedException {
        IExecutorService service = client.getExecutorService(randomString());

        String mapName = randomString();
        Object givenResult = "givenResult";
        Future future = service.submit(new MapPutRunnable(mapName), givenResult);
        Object result = future.get();

        IMap map = client.getMap(mapName);

        assertEquals(givenResult, result);
View Full Code Here

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

        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        final CountDownLatch responseLatch = new CountDownLatch(1);

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

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

        String mapName = randomString();
        Runnable runnable = new MapPutRunnable(mapName);
        final CountDownLatch responseLatch = new CountDownLatch(1);

        service.submitToKeyOwner(runnable, "key", new ExecutionCallback() {
            public void onResponse(Object response) {
                responseLatch.countDown();
View Full Code Here

    public void testExecute_withNoMemberSelected() {
        IExecutorService service = client.getExecutorService(randomString());
        String mapName = randomString();
        MemberSelector selector = new SelectNoMembers();

        service.execute(new MapPutRunnable(mapName), selector);
    }
View Full Code Here

TOP

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

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.