@Override public Throwable createException(String message, Throwable cause) { return new CacheNotExistsException(message); } });
@Override public Throwable createException(String message, Throwable cause) { return new CacheNotExistsException(message); } });
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()); }
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()); }
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); }
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); }
@Override public ClientProxy create(String id, ClientContext context) { CacheConfig cacheConfig = findCacheConfig(id); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + id + " is already destroyed or not created yet"); } NearCacheConfig nearCacheConfig = client.getClientConfig().getNearCacheConfig(cacheConfig.getName()); if (nearCacheConfig != null) { return new NearCachedClientCacheProxy(cacheConfig, context); } return new ClientCacheProxy(cacheConfig, context); }
@Override public ClientProxy create(String id, ClientContext context) { CacheConfig cacheConfig = findCacheConfig(id); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + id + " is already destroyed or not created yet"); } NearCacheConfig nearCacheConfig = client.getClientConfig().getNearCacheConfig(cacheConfig.getName()); if (nearCacheConfig != null) { return new NearCachedClientCacheProxy(cacheConfig, context); } return new ClientCacheProxy(cacheConfig, context); }
/** * {@inheritDoc} * * @throws CacheNotExistsException if the cache configuration was not found */ @Override public EventJournalConfig getEventJournalConfig(ObjectNamespace namespace) { String name = namespace.getObjectName(); CacheConfig cacheConfig = getCacheService().getCacheConfig(name); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + name + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember()); } String cacheSimpleName = cacheConfig.getName(); EventJournalConfig config = nodeEngine.getConfig().findCacheEventJournalConfig(cacheSimpleName); if (config == null || !config.isEnabled()) { return null; } return config; }
/** * {@inheritDoc} * * @throws CacheNotExistsException if the cache configuration was not found */ @Override public EventJournalConfig getEventJournalConfig(ObjectNamespace namespace) { String name = namespace.getObjectName(); CacheConfig cacheConfig = getCacheService().getCacheConfig(name); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + name + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember()); } String cacheSimpleName = cacheConfig.getName(); EventJournalConfig config = nodeEngine.getConfig().findCacheEventJournalConfig(cacheSimpleName); if (config == null || !config.isEnabled()) { return null; } return config; }
throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix);
throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix);
/** * {@inheritDoc} * * @throws CacheNotExistsException if the cache configuration was not found */ @Override public RingbufferConfig toRingbufferConfig(EventJournalConfig config, ObjectNamespace namespace) { CacheConfig cacheConfig = getCacheService().getCacheConfig(namespace.getObjectName()); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + namespace.getObjectName() + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember()); } int partitionCount = nodeEngine.getPartitionService().getPartitionCount(); return new RingbufferConfig() .setAsyncBackupCount(cacheConfig.getAsyncBackupCount()) .setBackupCount(cacheConfig.getBackupCount()) .setInMemoryFormat(InMemoryFormat.OBJECT) .setCapacity(config.getCapacity() / partitionCount) .setTimeToLiveSeconds(config.getTimeToLiveSeconds()); }
/** * {@inheritDoc} * * @throws CacheNotExistsException if the cache configuration was not found */ @Override public RingbufferConfig toRingbufferConfig(EventJournalConfig config, ObjectNamespace namespace) { CacheConfig cacheConfig = getCacheService().getCacheConfig(namespace.getObjectName()); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + namespace.getObjectName() + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember()); } int partitionCount = nodeEngine.getPartitionService().getPartitionCount(); return new RingbufferConfig() .setAsyncBackupCount(cacheConfig.getAsyncBackupCount()) .setBackupCount(cacheConfig.getBackupCount()) .setInMemoryFormat(InMemoryFormat.OBJECT) .setCapacity(config.getCapacity() / partitionCount) .setTimeToLiveSeconds(config.getTimeToLiveSeconds()); }
this.cacheConfig = cacheService.getCacheConfig(cacheNameWithPrefix); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + cacheNameWithPrefix + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember());
this.cacheConfig = cacheService.getCacheConfig(cacheNameWithPrefix); if (cacheConfig == null) { throw new CacheNotExistsException("Cache " + cacheNameWithPrefix + " is already destroyed or not created yet, on " + nodeEngine.getLocalMember());