public abstract class AbstractRemoteCacheService extends java.lang.Object implements IRemoteCacheService
Constructor and Description |
---|
AbstractRemoteCacheService(ICompositeCacheManager cacheManager,
ICacheEventLogger cacheEventLogger)
Creates the super with the needed items.
|
Modifier and Type | Method and Description |
---|---|
protected ICacheEvent |
createICacheEvent(ICacheElement item,
long requesterId,
java.lang.String eventName)
Logs an event if an event logger is configured.
|
protected ICacheEvent |
createICacheEvent(java.lang.String cacheName,
java.io.Serializable key,
long requesterId,
java.lang.String eventName)
Logs an event if an event logger is configured.
|
void |
dispose(java.lang.String cacheName)
Frees the specified remote cache.
|
void |
dispose(java.lang.String cacheName,
long requesterId)
Frees the specified remote cache.
|
ICacheElement |
get(java.lang.String cacheName,
java.io.Serializable key)
Returns a cache value from the specified remote cache; or null if the cache or key does not
exist.
|
ICacheElement |
get(java.lang.String cacheName,
java.io.Serializable key,
long requesterId)
Returns a cache bean from the specified cache; or null if the key does not exist.
|
protected ICompositeCacheManager |
getCacheManager() |
protected java.lang.String |
getEventLogSourceName() |
protected abstract java.lang.String |
getExtraInfoForRequesterId(long requesterId)
Ip address for the client, if one is stored.
|
java.util.Set |
getGroupKeys(java.lang.String cacheName,
java.lang.String group)
Gets the set of keys of objects currently in the group.
|
java.util.Map |
getMatching(java.lang.String cacheName,
java.lang.String pattern)
Gets all matching items.
|
java.util.Map |
getMatching(java.lang.String cacheName,
java.lang.String pattern,
long requesterId)
Retrieves all matching keys.
|
java.util.Map |
getMultiple(java.lang.String cacheName,
java.util.Set keys)
Gets multiple items from the cache based on the given set of keys.
|
java.util.Map |
getMultiple(java.lang.String cacheName,
java.util.Set keys,
long requesterId)
Gets multiple items from the cache based on the given set of keys.
|
java.lang.String |
getStats()
Gets the stats attribute of the RemoteCacheServer object.
|
protected void |
logApplicationEvent(java.lang.String source,
java.lang.String eventName,
java.lang.String optionalDetails)
Logs an event if an event logger is configured.
|
protected void |
logICacheEvent(ICacheEvent cacheEvent)
Logs an event if an event logger is configured.
|
java.util.Set |
processGetGroupKeys(java.lang.String cacheName,
java.lang.String groupName)
Gets the set of keys of objects currently in the group.
|
void |
remove(java.lang.String cacheName,
java.io.Serializable key)
Removes the given key from the specified remote cache.
|
void |
remove(java.lang.String cacheName,
java.io.Serializable key,
long requesterId)
Remove the key from the cache region and don't tell the source listener about it.
|
void |
removeAll(java.lang.String cacheName)
Remove all keys from the specified remote cache.
|
void |
removeAll(java.lang.String cacheName,
long requesterId)
Remove all keys from the specified remote cache.
|
void |
setCacheEventLogger(ICacheEventLogger cacheEventLogger)
Allows it to be injected.
|
protected void |
setCacheManager(CompositeCacheManager cacheManager) |
protected void |
setEventLogSourceName(java.lang.String eventLogSourceName) |
void |
update(ICacheElement item)
Puts a cache item to the cache.
|
void |
update(ICacheElement item,
long requesterId)
The internal processing is wrapped in event logging calls.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
release
public AbstractRemoteCacheService(ICompositeCacheManager cacheManager, ICacheEventLogger cacheEventLogger)
cacheManager
- cacheEventLogger
- public void update(ICacheElement item) throws java.io.IOException
ICacheService
update
in interface ICacheService
item
- java.io.IOException
public void update(ICacheElement item, long requesterId) throws java.io.IOException
update
in interface IRemoteCacheService
item
- requesterId
- java.io.IOException
public ICacheElement get(java.lang.String cacheName, java.io.Serializable key) throws java.io.IOException
get
in interface ICacheService
cacheName
- key
- java.io.IOException
public ICacheElement get(java.lang.String cacheName, java.io.Serializable key, long requesterId) throws java.io.IOException
Adding the requestor id, allows the cache to determine the source of the get.
The internal processing is wrapped in event logging calls.
get
in interface IRemoteCacheService
cacheName
- key
- requesterId
- java.io.IOException
public java.util.Map getMatching(java.lang.String cacheName, java.lang.String pattern) throws java.io.IOException
getMatching
in interface ICacheService
cacheName
- pattern
- java.io.IOException
public java.util.Map getMatching(java.lang.String cacheName, java.lang.String pattern, long requesterId) throws java.io.IOException
getMatching
in interface IRemoteCacheService
cacheName
- pattern
- requesterId
- java.io.IOException
public java.util.Map getMultiple(java.lang.String cacheName, java.util.Set keys) throws java.io.IOException
getMultiple
in interface ICacheService
cacheName
- keys
- java.io.IOException
public java.util.Map getMultiple(java.lang.String cacheName, java.util.Set keys, long requesterId) throws java.io.IOException
The internal processing is wrapped in event logging calls.
getMultiple
in interface IRemoteCacheService
cacheName
- keys
- requesterId
- java.io.IOException
public java.util.Set getGroupKeys(java.lang.String cacheName, java.lang.String group)
getGroupKeys
in interface IRemoteCacheService
cacheName
- group
- public java.util.Set processGetGroupKeys(java.lang.String cacheName, java.lang.String groupName)
cacheName
- groupName
- public void remove(java.lang.String cacheName, java.io.Serializable key) throws java.io.IOException
remove
in interface ICacheService
cacheName
- key
- java.io.IOException
public void remove(java.lang.String cacheName, java.io.Serializable key, long requesterId) throws java.io.IOException
The internal processing is wrapped in event logging calls.
remove
in interface IRemoteCacheService
cacheName
- key
- requesterId
- java.io.IOException
public void removeAll(java.lang.String cacheName) throws java.io.IOException
removeAll
in interface ICacheService
cacheName
- java.io.IOException
public void removeAll(java.lang.String cacheName, long requesterId) throws java.io.IOException
The internal processing is wrapped in event logging calls.
removeAll
in interface IRemoteCacheService
cacheName
- requesterId
- java.io.IOException
public void dispose(java.lang.String cacheName) throws java.io.IOException
dispose
in interface ICacheService
cacheName
- java.io.IOException
public void dispose(java.lang.String cacheName, long requesterId) throws java.io.IOException
cacheName
- requesterId
- java.io.IOException
public java.lang.String getStats() throws java.io.IOException
java.io.IOException
protected ICacheEvent createICacheEvent(ICacheElement item, long requesterId, java.lang.String eventName)
item
- requesterId
- eventName
- protected ICacheEvent createICacheEvent(java.lang.String cacheName, java.io.Serializable key, long requesterId, java.lang.String eventName)
cacheName
- key
- requesterId
- eventName
- protected void logApplicationEvent(java.lang.String source, java.lang.String eventName, java.lang.String optionalDetails)
source
- eventName
- optionalDetails
- protected void logICacheEvent(ICacheEvent cacheEvent)
cacheEvent
- protected abstract java.lang.String getExtraInfoForRequesterId(long requesterId)
Protected for testing.
requesterId
- public void setCacheEventLogger(ICacheEventLogger cacheEventLogger)
cacheEventLogger
- protected void setCacheManager(CompositeCacheManager cacheManager)
cacheManager
- the cacheManager to setprotected ICompositeCacheManager getCacheManager()
protected void setEventLogSourceName(java.lang.String eventLogSourceName)
eventLogSourceName
- the eventLogSourceName to setprotected java.lang.String getEventLogSourceName()
Copyright © 2002-2013 Apache Software Foundation. All Rights Reserved.