Search in sources :

Example 1 with CacheNotExistsException

use of com.hazelcast.cache.CacheNotExistsException in project hazelcast by hazelcast.

the class AbstractCacheAllPartitionsTask method getOperationProvider.

protected CacheOperationProvider getOperationProvider(String name) {
    ICacheService service = getService(CacheService.SERVICE_NAME);
    CacheConfig cacheConfig = service.getCacheConfig(name);
    if (cacheConfig == null) {
        throw new CacheNotExistsException("Cache config for cache " + name + " has not been created yet!");
    }
    return service.getCacheOperationProvider(name, cacheConfig.getInMemoryFormat());
}
Also used : ICacheService(com.hazelcast.cache.impl.ICacheService) CacheConfig(com.hazelcast.config.CacheConfig) CacheNotExistsException(com.hazelcast.cache.CacheNotExistsException)

Example 2 with CacheNotExistsException

use of com.hazelcast.cache.CacheNotExistsException in project hazelcast by hazelcast.

the class AbstractCacheMessageTask method getOperationProvider.

protected CacheOperationProvider getOperationProvider(String name) {
    ICacheService service = getService(CacheService.SERVICE_NAME);
    final CacheConfig cacheConfig = service.getCacheConfig(name);
    if (cacheConfig == null) {
        throw new CacheNotExistsException("Cache " + name + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember());
    }
    final InMemoryFormat inMemoryFormat = cacheConfig.getInMemoryFormat();
    return service.getCacheOperationProvider(name, inMemoryFormat);
}
Also used : ICacheService(com.hazelcast.cache.impl.ICacheService) LegacyCacheConfig(com.hazelcast.config.LegacyCacheConfig) CacheConfig(com.hazelcast.config.CacheConfig) CacheNotExistsException(com.hazelcast.cache.CacheNotExistsException) InMemoryFormat(com.hazelcast.config.InMemoryFormat)

Aggregations

CacheNotExistsException (com.hazelcast.cache.CacheNotExistsException)2 ICacheService (com.hazelcast.cache.impl.ICacheService)2 CacheConfig (com.hazelcast.config.CacheConfig)2 InMemoryFormat (com.hazelcast.config.InMemoryFormat)1 LegacyCacheConfig (com.hazelcast.config.LegacyCacheConfig)1