Package com.hazelcast.client.cache.impl

Examples of com.hazelcast.client.cache.impl.HazelcastClientCachingProvider


        final String cacheName = "test";
        final String key1 = "key1";
        final String valuecm1 = "Value-is-cm1";
        final String valuecm2 = "Value-is-cm2";

        final HazelcastClientCachingProvider cachingProvider = new HazelcastClientCachingProvider();
        final CacheManager cm1 = cachingProvider.getCacheManager(uri1, null);
        final CacheManager cm2 = cachingProvider.getCacheManager(uri2, null);
        final CacheConfig<String, String> cacheConfig = new CacheConfig<String, String>();
        final Cache<String, String> cache1 = cm1.createCache(cacheName, cacheConfig);
        final Cache<String, String> cache2 = cm2.createCache(cacheName, cacheConfig);

        cache1.put(key1, valuecm1);
        cache2.put(key1, valuecm2);

        assertEquals(valuecm1, cache1.get(key1));
        assertEquals(valuecm2, cache2.get(key1));

        cachingProvider.close(uri1, null);
        cachingProvider.close(uri2, null);
//        cm1.close();
//        cm2.close();

        final CacheManager cm11 = cachingProvider.getCacheManager(uri1, null);

        final Cache<String, String> cache11 = cm11.getCache(cacheName);

        assertEquals(valuecm1, cache11.get(key1));
View Full Code Here

TOP

Related Classes of com.hazelcast.client.cache.impl.HazelcastClientCachingProvider

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.