Package javax.cache

Examples of javax.cache.CacheManager.createCache()


        CompleteConfiguration<Integer, String> config =
                new MutableConfiguration<Integer, String>()
                        .setTypes(Integer.class, String.class);

        Cache<Integer, String> cache = cacheManager.createCache(cacheName, config);

        cache.invoke(1, new SimpleBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();
View Full Code Here


        CompleteConfiguration<Integer, String> config =
                new MutableConfiguration<Integer, String>()
                        .setTypes(Integer.class, String.class);

        Cache<Integer, String> cache = cacheManager.createCache(cacheName, config);

        cache.invoke(1, new NullBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();
View Full Code Here

        CompleteConfiguration<Integer, String> config =
                new MutableConfiguration<Integer, String>()
                        .setTypes(Integer.class, String.class);

        Cache<Integer, String> cache = cacheManager.createCache(cacheName, config);

        cache.invoke(1, new CustomBackupAwareEntryProcessor());

        final Data key = serializationService.toData(1);
        final int partitionId = hz1.getPartitionService().getPartition(1).getPartitionId();
View Full Code Here

        final CacheConfig<String, Object> config = new CacheConfig<String, Object>();
        config.setTypes(String.class, Object.class);

        final CachingProvider cachingProvider = Caching.getCachingProvider();
        final CacheManager cacheManager = cachingProvider.getCacheManager();
        final Cache<String, Object> cache = cacheManager.createCache("default", config);

        ExecutorService es = Executors.newFixedThreadPool(THREAD_COUNT);
        for (int i = 0; i < THREAD_COUNT; i++) {
            es.submit(new Runnable() {
                public void run() {
View Full Code Here

        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));
View Full Code Here

        .setTypes(String.class, Integer.class)
        .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
        .setStatisticsEnabled(true);

    //create the cache
    cacheManager.createCache("simpleCache", config);

    //... and then later to get the cache
    Cache<String, Integer> cache = Caching.getCache("simpleCache",
        String.class, Integer.class);
View Full Code Here

    config.setTypes(String.class, Integer.class)
        .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
        .setStatisticsEnabled(true);

    //create the cache
    cacheManager.createCache("simpleCache2", config);

    //... and then later to get the cache
    Cache<String, Integer> cache = Caching.getCache("simpleCache2",
        String.class, Integer.class);
View Full Code Here

    MutableConfiguration config = new MutableConfiguration<String, Integer>();
    config.setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
        .setStatisticsEnabled(true);

    //create the cache
    cacheManager.createCache(cacheName, config);

    //... and then later to get the cache
    Cache<String, Integer> cache = cacheManager.getCache(cacheName);

    //use the cache
View Full Code Here

    MutableConfiguration config = new MutableConfiguration();
    config.setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
    .setStatisticsEnabled(true);

    //create the cache
    cacheManager.createCache(cacheName, config);

    //... and then later to get the cache
    Cache cache = cacheManager.getCache(cacheName);

    //use the cache
View Full Code Here

        config.setTypes(Object.class, Object.class)
                .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))
                .setStatisticsEnabled(true);

        //create the cache
        cacheManager.createCache("simpleCache4", config);

        //... and then later to get the cache
        Cache<Object, Object> cache = Caching.getCache("simpleCache4",
                Object.class, Object.class);
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.