Search in sources :

Example 1 with ICacheInternal

use of com.hazelcast.cache.impl.ICacheInternal in project hazelcast by hazelcast.

the class HazelcastClientCacheManager method createCacheProxy.

@Override
protected <K, V> ICacheInternal<K, V> createCacheProxy(CacheConfig<K, V> cacheConfig) {
    clientCacheProxyFactory.addCacheConfig(cacheConfig.getNameWithPrefix(), cacheConfig);
    try {
        ClientICacheManager cacheManager = client.getCacheManager();
        String nameWithPrefix = cacheConfig.getNameWithPrefix();
        ICacheInternal<K, V> cache = (ICacheInternal<K, V>) cacheManager.getCacheByFullName(nameWithPrefix);
        cache.setCacheManager(this);
        return cache;
    } catch (Throwable t) {
        clientCacheProxyFactory.removeCacheConfig(cacheConfig.getNameWithPrefix());
        throw rethrow(t);
    }
}
Also used : ClientICacheManager(com.hazelcast.client.impl.clientside.ClientICacheManager) ICacheInternal(com.hazelcast.cache.impl.ICacheInternal)

Example 2 with ICacheInternal

use of com.hazelcast.cache.impl.ICacheInternal in project hazelcast by hazelcast.

the class AbstractClientCachePartitionIteratorTest method getCacheProxy.

private <K, V> ICacheInternal<K, V> getCacheProxy() {
    String cacheName = randomString();
    CacheManager cacheManager = cachingProvider.getCacheManager();
    CacheConfig<K, V> config = new CacheConfig<K, V>();
    config.getEvictionConfig().setMaxSizePolicy(MaxSizePolicy.ENTRY_COUNT).setSize(10000000);
    return (ICacheInternal<K, V>) cacheManager.createCache(cacheName, config);
}
Also used : CacheManager(javax.cache.CacheManager) CacheConfig(com.hazelcast.config.CacheConfig) ICacheInternal(com.hazelcast.cache.impl.ICacheInternal)

Aggregations

ICacheInternal (com.hazelcast.cache.impl.ICacheInternal)2 ClientICacheManager (com.hazelcast.client.impl.clientside.ClientICacheManager)1 CacheConfig (com.hazelcast.config.CacheConfig)1 CacheManager (javax.cache.CacheManager)1