com.hazelcast.cache.impl
Class AbstractCacheService
java.lang.Object
com.hazelcast.cache.impl.AbstractCacheService
- All Implemented Interfaces:
- ICacheService, EventPublishingService<Object,CacheEventListener>, ManagedService, MigrationAwareService, RemoteService
- Direct Known Subclasses:
- CacheService
public abstract class AbstractCacheService
- extends Object
- implements ICacheService
Method Summary |
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)
Creates a distributed object. |
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)
Destroys a distributed object. |
protected void |
destroySegments(String objectName)
|
void |
dispatchEvent(Object event,
CacheEventListener listener)
|
CacheSimpleConfig |
findCacheConfig(String simpleName)
|
CacheConfig |
getCacheConfig(String name)
|
protected
|
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)
|
CachePartitionSegment |
getSegment(int partitionId)
|
CacheStatisticsImpl |
getStatistics(String name)
|
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this ManagedService |
protected void |
postInit(NodeEngine nodeEngine,
Properties properties)
|
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,
long expirationTime,
String origin)
|
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
configs
protected final ConcurrentMap<String,CacheConfig> configs
statistics
protected final ConcurrentMap<String,CacheStatisticsImpl> statistics
resources
protected final ConcurrentMap<String,Set<Closeable>> resources
closeableListeners
protected final ConcurrentMap<String,Closeable> closeableListeners
operationProviderCache
protected final ConcurrentMap<String,CacheOperationProvider> operationProviderCache
cacheStatisticsConstructorFunction
protected final ConstructorFunction<String,CacheStatisticsImpl> cacheStatisticsConstructorFunction
nodeEngine
protected NodeEngine nodeEngine
segments
protected CachePartitionSegment[] segments
AbstractCacheService
public AbstractCacheService()
init
public final void init(NodeEngine nodeEngine,
Properties properties)
- Description copied from interface:
ManagedService
- Initializes this ManagedService
- Specified by:
init
in interface ManagedService
- Parameters:
nodeEngine
- the NodeEngine that this ManagedService belongs to.properties
- the Properties. Can be used to pass settings to the service.
postInit
protected void postInit(NodeEngine nodeEngine,
Properties properties)
createNewRecordStore
protected abstract ICacheRecordStore createNewRecordStore(String name,
int partitionId)
createDistributedObject
public DistributedObject createDistributedObject(String objectName)
- Description copied from interface:
RemoteService
- Creates a distributed object.
- Specified by:
createDistributedObject
in interface RemoteService
- Parameters:
objectName
- the name for the created distributed object
- Returns:
- the created distributed object
destroyDistributedObject
public void destroyDistributedObject(String objectName)
- Description copied from interface:
RemoteService
- Destroys a distributed object.
- Specified by:
destroyDistributedObject
in interface RemoteService
- Parameters:
objectName
- the name of the distributed object to destroy
beforeMigration
public void beforeMigration(PartitionMigrationEvent event)
- Specified by:
beforeMigration
in interface MigrationAwareService
commitMigration
public void commitMigration(PartitionMigrationEvent event)
- Specified by:
commitMigration
in interface MigrationAwareService
rollbackMigration
public void rollbackMigration(PartitionMigrationEvent event)
- Specified by:
rollbackMigration
in interface MigrationAwareService
clearPartitionReplica
public void clearPartitionReplica(int partitionId)
- Specified by:
clearPartitionReplica
in interface MigrationAwareService
getOrCreateCache
public ICacheRecordStore getOrCreateCache(String name,
int partitionId)
- Specified by:
getOrCreateCache
in interface ICacheService
getCacheRecordStore
public ICacheRecordStore getCacheRecordStore(String name,
int partitionId)
- Specified by:
getCacheRecordStore
in interface ICacheService
getSegment
public CachePartitionSegment getSegment(int partitionId)
- Specified by:
getSegment
in interface ICacheService
destroySegments
protected void destroySegments(String objectName)
destroyCache
public void destroyCache(String objectName,
boolean isLocal,
String callerUuid)
- Specified by:
destroyCache
in interface ICacheService
destroyCacheOnAllMembers
protected void destroyCacheOnAllMembers(String objectName,
String callerUuid)
createCacheConfigIfAbsent
public CacheConfig createCacheConfigIfAbsent(CacheConfig config)
- Specified by:
createCacheConfigIfAbsent
in interface ICacheService
deleteCacheConfig
public CacheConfig deleteCacheConfig(String name)
- Specified by:
deleteCacheConfig
in interface ICacheService
createCacheStatIfAbsent
public CacheStatisticsImpl createCacheStatIfAbsent(String name)
- Specified by:
createCacheStatIfAbsent
in interface ICacheService
deleteCacheStat
public void deleteCacheStat(String name)
- Specified by:
deleteCacheStat
in interface ICacheService
setStatisticsEnabled
public void setStatisticsEnabled(CacheConfig cacheConfig,
String cacheNameWithPrefix,
boolean enabled)
- Specified by:
setStatisticsEnabled
in interface ICacheService
setManagementEnabled
public void setManagementEnabled(CacheConfig cacheConfig,
String cacheNameWithPrefix,
boolean enabled)
- Specified by:
setManagementEnabled
in interface ICacheService
getCacheConfig
public CacheConfig getCacheConfig(String name)
- Specified by:
getCacheConfig
in interface ICacheService
findCacheConfig
public CacheSimpleConfig findCacheConfig(String simpleName)
- Specified by:
findCacheConfig
in interface ICacheService
getCacheConfigFromPartition
protected <K,V> CacheConfig<K,V> getCacheConfigFromPartition(String cacheNameWithPrefix,
String cacheName)
getCacheConfigs
public Collection<CacheConfig> getCacheConfigs()
- Specified by:
getCacheConfigs
in interface ICacheService
toObject
public Object toObject(Object data)
toData
public Data toData(Object object)
publishEvent
public void publishEvent(String cacheName,
CacheEventType eventType,
Data dataKey,
Data dataValue,
Data dataOldValue,
boolean isOldValueAvailable,
int orderKey,
int completionId,
long expirationTime,
String origin)
- Specified by:
publishEvent
in interface ICacheService
publishEvent
public void publishEvent(String cacheName,
CacheEventSet eventSet,
int orderKey)
- Specified by:
publishEvent
in interface ICacheService
getNodeEngine
public NodeEngine getNodeEngine()
- Specified by:
getNodeEngine
in interface ICacheService
dispatchEvent
public void dispatchEvent(Object event,
CacheEventListener listener)
- Specified by:
dispatchEvent
in interface EventPublishingService<Object,CacheEventListener>
registerListener
public String registerListener(String distributedObjectName,
CacheEventListener listener)
- Specified by:
registerListener
in interface ICacheService
deregisterListener
public boolean deregisterListener(String name,
String registrationId)
- Specified by:
deregisterListener
in interface ICacheService
deregisterAllListener
public void deregisterAllListener(String name)
- Specified by:
deregisterAllListener
in interface ICacheService
getStatistics
public CacheStatisticsImpl getStatistics(String name)
- Specified by:
getStatistics
in interface ICacheService
getCacheOperationProvider
public CacheOperationProvider getCacheOperationProvider(String nameWithPrefix,
InMemoryFormat inMemoryFormat)
- Description copied from interface:
ICacheService
- Creates cache operations according to the storage-type of the cache
- Specified by:
getCacheOperationProvider
in interface ICacheService
addCacheResource
public void addCacheResource(String name,
Closeable resource)
Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.