Package com.hazelcast.core

Examples of com.hazelcast.core.TransactionalMap.replace()


            case PUT_WITH_TTL:
                return map.put(key, value, ttl, TimeUnit.MILLISECONDS);
            case PUT_IF_ABSENT:
                return map.putIfAbsent(key, value);
            case REPLACE:
                return map.replace(key, value);
            case REPLACE_IF_SAME:
                return map.replace(key, value, newValue);
            case SET:
                map.set(key, value);
                break;
View Full Code Here


            case PUT_IF_ABSENT:
                return map.putIfAbsent(key, value);
            case REPLACE:
                return map.replace(key, value);
            case REPLACE_IF_SAME:
                return map.replace(key, value, newValue);
            case SET:
                map.set(key, value);
                break;
            case REMOVE:
                return map.remove(key);
View Full Code Here

        final TransactionContext context = client.newTransactionContext();
        context.beginTransaction();
        final TransactionalMap txMap = context.getMap(mapName);

        txMap.replace(key1, replaceValue);
        txMap.replace(key2, "NOT_POSSIBLE");

        context.commitTransaction();

        assertEquals(replaceValue, map.get(key1));
View Full Code Here

        final TransactionContext context = client.newTransactionContext();
        context.beginTransaction();
        final TransactionalMap txMap = context.getMap(mapName);

        txMap.replace(key1, replaceValue);
        txMap.replace(key2, "NOT_POSSIBLE");

        context.commitTransaction();

        assertEquals(replaceValue, map.get(key1));
        assertNull(map.get(key2));
View Full Code Here

        final TransactionContext context = client.newTransactionContext();
        context.beginTransaction();
        final TransactionalMap txMap = context.getMap(mapName);

        txMap.replace(key1, oldValue1, newValue1);
        txMap.replace(key2, "NOT_OLD_VALUE", "NEW_VALUE_CANT_BE_THIS");

        context.commitTransaction();

        assertEquals(newValue1, map.get(key1));
View Full Code Here

        final TransactionContext context = client.newTransactionContext();
        context.beginTransaction();
        final TransactionalMap txMap = context.getMap(mapName);

        txMap.replace(key1, oldValue1, newValue1);
        txMap.replace(key2, "NOT_OLD_VALUE", "NEW_VALUE_CANT_BE_THIS");

        context.commitTransaction();

        assertEquals(newValue1, map.get(key1));
        assertEquals(oldValue2, map.get(key2));
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.