public abstract class AbstractCacheService extends Object implements ICacheService, PostJoinAwareService
| Modifier and Type | Field and Description |
|---|---|
protected ConstructorFunction<String,CacheStatisticsImpl> |
cacheStatisticsConstructorFunction |
protected ConcurrentMap<String,Closeable> |
closeableListeners |
protected ConcurrentMap<String,CacheConfig> |
configs |
protected NodeEngine |
nodeEngine |
protected ConcurrentMap<String,CacheOperationProvider> |
operationProviderCache |
protected ConcurrentMap<String,Set<Closeable>> |
resources |
protected CachePartitionSegment[] |
segments |
protected ConcurrentMap<String,CacheStatisticsImpl> |
statistics |
SERVICE_NAME| Constructor and Description |
|---|
AbstractCacheService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCacheResource(String name,
Closeable resource) |
void |
beforeMigration(PartitionMigrationEvent event) |
void |
clearPartitionReplica(int partitionId) |
void |
commitMigration(PartitionMigrationEvent event) |
CacheConfig |
createCacheConfigIfAbsent(CacheConfig config) |
CacheStatisticsImpl |
createCacheStatIfAbsent(String name) |
DistributedObject |
createDistributedObject(String objectName) |
protected abstract ICacheRecordStore |
createNewRecordStore(String name,
int partitionId) |
CacheConfig |
deleteCacheConfig(String name) |
void |
deleteCacheStat(String name) |
void |
deregisterAllListener(String name) |
boolean |
deregisterListener(String name,
String registrationId) |
void |
destroyCache(String objectName,
boolean isLocal,
String callerUuid) |
protected void |
destroyCacheOnAllMembers(String objectName,
String callerUuid) |
void |
destroyDistributedObject(String objectName) |
protected void |
destroySegments(String objectName) |
void |
dispatchEvent(Object event,
CacheEventListener listener) |
CacheSimpleConfig |
findCacheConfig(String simpleName) |
CacheConfig |
getCacheConfig(String name) |
protected <K,V> CacheConfig<K,V> |
getCacheConfigFromPartition(String cacheNameWithPrefix,
String cacheName) |
Collection<CacheConfig> |
getCacheConfigs() |
CacheOperationProvider |
getCacheOperationProvider(String nameWithPrefix,
InMemoryFormat inMemoryFormat)
Creates cache operations according to the storage-type of the cache
|
ICacheRecordStore |
getCacheRecordStore(String name,
int partitionId) |
NodeEngine |
getNodeEngine() |
ICacheRecordStore |
getOrCreateCache(String name,
int partitionId) |
Operation |
getPostJoinOperation()
Post join operations must be lock free; means no locks at all;
no partition locks, no key-based locks, no service level locks or
no database interaction!
|
CachePartitionSegment |
getSegment(int partitionId) |
CacheStatisticsImpl |
getStatistics(String name) |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this ManagedService
|
void |
publishEvent(String cacheName,
CacheEventSet eventSet,
int orderKey) |
void |
publishEvent(String cacheName,
CacheEventType eventType,
Data dataKey,
Data dataValue,
Data dataOldValue,
boolean isOldValueAvailable,
int orderKey,
int completionId) |
String |
registerListener(String distributedObjectName,
CacheEventListener listener) |
void |
rollbackMigration(PartitionMigrationEvent event) |
void |
setManagementEnabled(CacheConfig cacheConfig,
String cacheNameWithPrefix,
boolean enabled) |
void |
setStatisticsEnabled(CacheConfig cacheConfig,
String cacheNameWithPrefix,
boolean enabled) |
Data |
toData(Object object) |
Object |
toObject(Object data) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreset, shutdownprepareReplicationOperationprotected final ConcurrentMap<String,CacheConfig> configs
protected final ConcurrentMap<String,CacheStatisticsImpl> statistics
protected final ConcurrentMap<String,Set<Closeable>> resources
protected final ConcurrentMap<String,Closeable> closeableListeners
protected final ConcurrentMap<String,CacheOperationProvider> operationProviderCache
protected final ConstructorFunction<String,CacheStatisticsImpl> cacheStatisticsConstructorFunction
protected NodeEngine nodeEngine
protected CachePartitionSegment[] segments
public final void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine this ManagedService belongs to.properties - the Properties. Can be used to pass settings to the service.protected abstract ICacheRecordStore createNewRecordStore(String name, int partitionId)
public DistributedObject createDistributedObject(String objectName)
createDistributedObject in interface RemoteServicepublic void destroyDistributedObject(String objectName)
destroyDistributedObject in interface RemoteServicepublic void beforeMigration(PartitionMigrationEvent event)
beforeMigration in interface MigrationAwareServicepublic void commitMigration(PartitionMigrationEvent event)
commitMigration in interface MigrationAwareServicepublic void rollbackMigration(PartitionMigrationEvent event)
rollbackMigration in interface MigrationAwareServicepublic void clearPartitionReplica(int partitionId)
clearPartitionReplica in interface MigrationAwareServicepublic ICacheRecordStore getOrCreateCache(String name, int partitionId)
getOrCreateCache in interface ICacheServicepublic ICacheRecordStore getCacheRecordStore(String name, int partitionId)
getCacheRecordStore in interface ICacheServicepublic CachePartitionSegment getSegment(int partitionId)
getSegment in interface ICacheServiceprotected void destroySegments(String objectName)
public void destroyCache(String objectName, boolean isLocal, String callerUuid)
destroyCache in interface ICacheServiceprotected void destroyCacheOnAllMembers(String objectName, String callerUuid)
public CacheConfig createCacheConfigIfAbsent(CacheConfig config)
createCacheConfigIfAbsent in interface ICacheServicepublic CacheConfig deleteCacheConfig(String name)
deleteCacheConfig in interface ICacheServicepublic CacheStatisticsImpl createCacheStatIfAbsent(String name)
createCacheStatIfAbsent in interface ICacheServicepublic void deleteCacheStat(String name)
deleteCacheStat in interface ICacheServicepublic void setStatisticsEnabled(CacheConfig cacheConfig, String cacheNameWithPrefix, boolean enabled)
setStatisticsEnabled in interface ICacheServicepublic void setManagementEnabled(CacheConfig cacheConfig, String cacheNameWithPrefix, boolean enabled)
setManagementEnabled in interface ICacheServicepublic CacheConfig getCacheConfig(String name)
getCacheConfig in interface ICacheServicepublic CacheSimpleConfig findCacheConfig(String simpleName)
findCacheConfig in interface ICacheServiceprotected <K,V> CacheConfig<K,V> getCacheConfigFromPartition(String cacheNameWithPrefix, String cacheName)
public Collection<CacheConfig> getCacheConfigs()
getCacheConfigs in interface ICacheServicepublic void publishEvent(String cacheName, CacheEventType eventType, Data dataKey, Data dataValue, Data dataOldValue, boolean isOldValueAvailable, int orderKey, int completionId)
publishEvent in interface ICacheServicepublic void publishEvent(String cacheName, CacheEventSet eventSet, int orderKey)
publishEvent in interface ICacheServicepublic NodeEngine getNodeEngine()
getNodeEngine in interface ICacheServicepublic void dispatchEvent(Object event, CacheEventListener listener)
dispatchEvent in interface EventPublishingService<Object,CacheEventListener>public String registerListener(String distributedObjectName, CacheEventListener listener)
registerListener in interface ICacheServicepublic boolean deregisterListener(String name, String registrationId)
deregisterListener in interface ICacheServicepublic void deregisterAllListener(String name)
deregisterAllListener in interface ICacheServicepublic CacheStatisticsImpl getStatistics(String name)
getStatistics in interface ICacheServicepublic CacheOperationProvider getCacheOperationProvider(String nameWithPrefix, InMemoryFormat inMemoryFormat)
ICacheServicegetCacheOperationProvider in interface ICacheServicepublic Operation getPostJoinOperation()
PostJoinAwareServicePost join operations should return response, at least a null response.
getPostJoinOperation in interface PostJoinAwareServiceCopyright © 2015 Hazelcast, Inc.. All Rights Reserved.