use of com.hazelcast.config.CacheConfig in project hazelcast by hazelcast.
the class CacheGetConfigOperation method run.
@Override
public void run() throws Exception {
final ICacheService service = getService();
CacheConfig cacheConfig = service.getCacheConfig(name);
if (cacheConfig == null) {
cacheConfig = service.findCacheConfig(simpleName);
if (cacheConfig != null) {
cacheConfig.setManagerPrefix(name.substring(0, name.lastIndexOf(simpleName)));
CacheConfig existingCacheConfig = service.putCacheConfigIfAbsent(cacheConfig);
if (existingCacheConfig != null) {
cacheConfig = existingCacheConfig;
}
}
}
response = cacheConfig;
}
use of com.hazelcast.config.CacheConfig in project hazelcast by hazelcast.
the class CacheListenerRegistrationOperation method run.
@Override
public void run() throws Exception {
final AbstractCacheService service = getService();
CacheConfig cacheConfig = service.getCacheConfig(name);
if (register) {
service.cacheEntryListenerRegistered(name, cacheEntryListenerConfiguration);
} else if (cacheConfig != null) {
service.cacheEntryListenerDeregistered(name, cacheEntryListenerConfiguration);
}
}
use of com.hazelcast.config.CacheConfig 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());
}
use of com.hazelcast.config.CacheConfig 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);
}
use of com.hazelcast.config.CacheConfig in project hazelcast by hazelcast.
the class CacheCreateConfigMessageTask method extractCacheConfigFromMessage.
private CacheConfig extractCacheConfigFromMessage() {
int clientVersion = getClientVersion();
CacheConfig cacheConfig = null;
if (BuildInfo.UNKNOWN_HAZELCAST_VERSION == clientVersion) {
boolean compatibilityEnabled = nodeEngine.getProperties().getBoolean(GroupProperty.COMPATIBILITY_3_6_CLIENT_ENABLED);
if (compatibilityEnabled) {
LegacyCacheConfig legacyCacheConfig = nodeEngine.toObject(parameters.cacheConfig, LegacyCacheConfig.class);
if (null == legacyCacheConfig) {
return null;
}
return legacyCacheConfig.getConfigAndReset();
}
}
return (CacheConfig) nodeEngine.toObject(parameters.cacheConfig);
}
Aggregations