public class DefaultCacheManager extends AbstractNurseryService implements CacheManager
GenericService.StartCommand, GenericService.StopCommand
CLASS_VERSION
mLogger, state
RELATIONSHIP_ACTIVEPOOL, RELATIONSHIP_REFERREDARTICLES, RELATIONSHIP_ROLEKEEPERS_PREFIX, RELATIONSHIP_SECTIONPOOL, RELATIONSHIP_SHADOWS, RELATIONSHIP_SUBSECTION
Constructor and Description |
---|
DefaultCacheManager()
Deprecated.
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCache(String key,
Object cache)
Deprecated.
Mapping between caches and layers, to provide
|
void |
cacheObject(IOObject object)
Deprecated.
Store an object in the cache.
|
void |
cacheObjects(IOObject[] objects)
Deprecated.
Store an array of objects in the cache.
|
void |
cacheRelationship(IOHashKey source,
String type,
IOHashKey[] targets,
Map[] attributeSets)
Deprecated.
Adds a set of relationsips to the cache.
|
void |
cacheRelationship(IOHashKey source,
String type,
IOHashKey target,
Map attributeSet)
Deprecated.
Adds a simple relationship to the cache.
|
boolean |
dropAllRelationshipsFor(IOHashKey hashKey)
Deprecated.
|
void |
dropLRUObjects()
Deprecated.
Drop a predefined number of least recently used objects.
|
void |
dropLRUObjects(int n)
Deprecated.
Drop the 'n' least recently used objects from the cache
|
boolean |
dropObject(IOHashKey objectKey)
Deprecated.
Tell the cache to drop an object.
|
int |
dropObjects(IOHashKey[] objectKeys)
Deprecated.
Tell the cache to drop an array of objects.
|
protected void |
dropRelationShip(IOHashKey objectKey,
IOHashKey relationKey,
Map pParameters)
Deprecated.
|
boolean |
dropRelationship(IOHashKey hashKey,
String relationship)
Deprecated.
Removes the specified relation from cache.
|
void |
expire(Object pCache,
int[] pIds,
String pWhat)
Deprecated.
|
void |
flushCache()
Deprecated.
|
Map |
getAttributeSet(IOHashKey key,
String relationship)
Deprecated.
Retreives all attributes belongning to the specified relation.
|
Map[] |
getAttributeSets(IOHashKey key,
String relationship)
Deprecated.
Retreives all attributes belongning to the specified relations.
|
Map |
getCacheMap()
Deprecated.
|
IOObject |
getObject(IOHashKey key)
Deprecated.
Lookup an object in the cache.
|
Cache |
getObjectCache()
Deprecated.
|
IOObject[] |
getObjects(IOHashKey[] keys)
Deprecated.
Retrieves an array of
IOObjects from cache. |
IOHashKey |
getRelationship(IOHashKey key,
String relationship)
Deprecated.
Retrieves a relation from cache that is of the specified type and belongs to the
IOObject
in question. |
Cache |
getRelationshipCache()
Deprecated.
|
IOHashKey[] |
getRelationships(IOHashKey key,
String relationship)
Deprecated.
Retrieves all relations from cache that are of the specified type and belongs to the
IOObject
in question. |
void |
handleEvent(IOEvent event)
Deprecated.
This method gets events from the IOAPI, and drops objects accordingly
|
protected void |
handleRelationship(IOEvent event)
Deprecated.
|
protected void |
handleRelationships(IOEvent event)
Deprecated.
|
void |
invalidateCaches(String pWhat,
String pDepth,
String pIds)
Deprecated.
|
void |
setObjectCache(Cache pObjectCache)
Deprecated.
|
void |
setRelationshipCache(Cache pRelationshipCache)
Deprecated.
|
protected void |
startService()
Deprecated.
Is called by
AbstractNurseryService.doStartService() when the NurseryService is being started. |
protected void |
status()
Deprecated.
|
protected void |
stopService()
Deprecated.
Is called by
AbstractNurseryService.doStopService() when the service is being shut down. |
String |
toString()
Deprecated.
|
doStartService, doStopService, stopIdleService
assertServiceRunning, getServiceDescription, getServiceMessage, getServiceState, isServiceEnabled, isServiceFailed, isServiceIdle, isServiceRunning, isServiceShutdownFailed, isServiceStopped, setServiceDescription, setServiceEnabled, start, stop, validateIsTrue, validateNotNull
public DefaultCacheManager()
protected void startService() throws IllegalStateException, IllegalArgumentException, Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStartService()
when the NurseryService
is being started. Exceptions thrown by this
method are logged by AbstractNurseryService.doStartService()
.
Subclasses must implement this method to bootstrap the service.
startService
in class AbstractNurseryService
IllegalStateException
- when this service is in the wrong state for startup. Used to signal to AbstractNurseryService.doStartService()
that it is OK to try to starting
this service
later. GenericService.isServiceRunning()
returns false
and GenericService.isServiceIdle()
returns true
.IllegalArgumentException
- when the configuration of the service
is invalid. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.Exception
- when something goes wrong during startup. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.AbstractNurseryService.doStartService()
protected void stopService() throws IllegalStateException, Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStopService()
when the service
is being shut down. Exceptions thrown by this
method are logged by AbstractNurseryService.doStopService()
.
Subclasses must implement this method to shut down the service.
stopService
in class AbstractNurseryService
IllegalStateException
- when this service is in the wrong state for shutdown. Used to signal to AbstractNurseryService.doStopService()
that
it is OK to try stopping this service
later. GenericService.isServiceRunning()
returns true
.Exception
- when something goes during shutdown. GenericService.isServiceRunning()
returns false
and
GenericService.isServiceShutdownFailed()
returns true
.AbstractNurseryService.doStopService()
public void setObjectCache(Cache pObjectCache)
public Cache getObjectCache()
public void setRelationshipCache(Cache pRelationshipCache)
public Cache getRelationshipCache()
public void handleEvent(IOEvent event)
handleEvent
in interface IOEventListener
event
- the eventpublic void flushCache()
public void cacheObject(IOObject object)
cacheObject
in interface CacheManager
object
- the object to addpublic void cacheObjects(IOObject[] objects)
cacheObjects
in interface CacheManager
objects
- the objects to addpublic void cacheRelationship(IOHashKey source, String type, IOHashKey target, Map attributeSet)
CacheManager
cacheRelationship
in interface CacheManager
source
- the source part of the relation to addtype
- the type of relation to addtarget
- the target part of the relation to addattributeSet
- the attributes belonging to the relation to addpublic void cacheRelationship(IOHashKey source, String type, IOHashKey[] targets, Map[] attributeSets)
CacheManager
cacheRelationship
in interface CacheManager
source
- the source part of the relations to addtype
- the type of relations to addtargets
- the target part of the relations to addattributeSets
- the attributes belonging to the relations to addpublic IOObject getObject(IOHashKey key)
getObject
in interface CacheManager
key
- the IOHashKey which refers to the object wantedpublic IOObject[] getObjects(IOHashKey[] keys)
CacheManager
IOObjects
from cache. It does an individual lookup
for each of the keys in the 'keys' parameter. The resulting
array is an array of the same length, where each element is null
or a reference to an IOObject, based on whether or not the object exists
in the cache.getObjects
in interface CacheManager
keys
- an array of keys to lookuppublic IOHashKey getRelationship(IOHashKey key, String relationship)
CacheManager
IOObject
in question.getRelationship
in interface CacheManager
key
- an IOHashKey
representation of the IOObject
to retrieve relations fromrelationship
- the type of relation to retrieveIOObject
in questionpublic IOHashKey[] getRelationships(IOHashKey key, String relationship)
CacheManager
IOObject
in question.getRelationships
in interface CacheManager
key
- an IOHashKey
representation of the IOObject
to retrieve relations fromrelationship
- the type of relation to retrieveIOObject
in questionpublic Map getAttributeSet(IOHashKey key, String relationship)
CacheManager
getAttributeSet
in interface CacheManager
key
- an IOHashKey
representation of the IOObject
to lookup relation byrelationship
- the type of relation to retrieve attributes fromMap
representation of attributespublic Map[] getAttributeSets(IOHashKey key, String relationship)
CacheManager
getAttributeSets
in interface CacheManager
key
- an IOHashKey
representation of the IOObject
to lookup relation byrelationship
- the type of relation to retrieve attributes fromMap
representations of attributespublic boolean dropObject(IOHashKey objectKey)
dropObject
in interface CacheManager
objectKey
- key to the object that should be droppedpublic int dropObjects(IOHashKey[] objectKeys)
dropObjects
in interface CacheManager
objectKeys
- the list of keys to objects that should be droppedprotected void handleRelationship(IOEvent event)
protected void dropRelationShip(IOHashKey objectKey, IOHashKey relationKey, Map pParameters)
protected void handleRelationships(IOEvent event)
public boolean dropAllRelationshipsFor(IOHashKey hashKey)
public boolean dropRelationship(IOHashKey hashKey, String relationship)
CacheManager
dropRelationship
in interface CacheManager
hashKey
- the relation to remove from cacherelationship
- the type of relation to remove from cachepublic void dropLRUObjects(int n)
dropLRUObjects
in interface CacheManager
n
- the number of objects to droppublic void dropLRUObjects()
CacheManager
dropLRUObjects
in interface CacheManager
public void addCache(String key, Object cache)
public Map getCacheMap()
protected void status()
© 1998- 2021 Escenic AS