|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.caleigo.core.AbstractDataService
org.caleigo.core.service.CachedDataService
The CachedDataService is a wrapper around any other IDataService implementation to wich it adds transparent cache functionality.
Nested Class Summary | |
protected class |
CachedDataService.CachedDataTransaction
|
protected class |
CachedDataService.CacheEntry
|
Nested classes inherited from class org.caleigo.core.AbstractDataService |
AbstractDataService.AbstractDataTransaction |
Field Summary | |
protected static int |
DEFAULT_MINIMUM_ENTITY_CACHE_TIME
|
protected static int |
DEFAULT_MINIMUM_TABLE_CACHE_TIME
|
protected IDataService |
mSourceDataService
|
protected static int |
QUERY_LIST_LIMIT
|
Fields inherited from class org.caleigo.core.AbstractDataService |
DEFAULT_TIMEOUT |
Constructor Summary | |
CachedDataService(IDataService sourceDataService)
Creates a new instance of CachedDataService |
Method Summary | |
protected void |
addToQueryList(IEntity entity)
|
void |
cacheEntityTable(IEntityDescriptor entityDescriptor)
This method loads a complete entity table from the wrapped IDataService and stores it as a selection in the cache´s hashtable. |
protected void |
deleteCachedEntity(IEntity entity)
Deletes the provided entity from the cache. |
protected ISelection |
getCachedEntityTable(IEntityDescriptor entityDescriptor)
Access method that retrieves a selection containing the entire stored table of entities for the provided entity descriptor. |
static int |
getMinimumEntityCacheTime()
|
static int |
getMinimumTableCacheTime()
|
IDataService |
getSourceDataService()
Access method that returns the IDataService object that cache functionality is added to by this class. |
boolean |
isQualifierProcessable(Qualifier qualifier,
IEntityDescriptor entityDescriptor)
Help methods that returns true if the provided qualifier can be processed internally by the table cache. |
static boolean |
isTableCachable(IEntityDescriptor entityDescriptor)
Access methods that returns true if the provided entity descriptor can be cached in the table cache. |
boolean |
isTableCached(IEntityDescriptor entityDescriptor)
Access methods that returns true if the provided entity descriptor is currently cached in the table cache. |
protected void |
loadEntityFromCache(Qualifier qualifier,
IEntity targetEntity)
Loads a qualified entity from the cache. |
protected boolean |
loadEntityFromQueryList(Qualifier qualifier,
IEntity targetEntity)
|
protected void |
loadSelectionFromCache(DataQuery dataQuery,
ISelection targetSelection)
Loads a qualified selection from the cache using a data query. |
protected void |
loadSelectionFromCache(IEntityDescriptor entityDescriptor,
Qualifier qualifier,
ISelection targetSelection)
Loads a qualified selection from the cache. |
IDataTransaction |
newTransaction()
Returns a new IDataTransaction object that can be used to batch data operations and wrap them in a transaction. |
boolean |
ping()
Should return true if the service is online and reponding to calls. |
protected void |
refreshCachedEntity(IEntity entity)
Updates the provided entity in the cache. |
void |
resetCache()
Completely resets the cache and "unloads" all cached data. |
static void |
setMinimumEntityCacheTime(int minimumEntityCacheTime)
|
static void |
setMinimumTableCacheTime(int minimumTableCacheTime)
|
void |
unloadEntityTable(IEntityDescriptor entityDescriptor)
Unloads the entity table indentified by the provided entity descriptor. |
Methods inherited from class org.caleigo.core.AbstractDataService |
checkEntityAsDeletable, checkEntityAsStorable, delete, finalizeService, getCustomProxyService, getDataSourceDescriptor, getServiceIdentity, getServiceInterface, getServiceInterfaceClass, getServiceType, getTimeout, hasCustomProxyService, initializeService, isValidating, load, loadSelection, loadSelection, refresh, setEntityData, setTimeout, setValidating, store |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int QUERY_LIST_LIMIT
protected static final int DEFAULT_MINIMUM_TABLE_CACHE_TIME
protected static final int DEFAULT_MINIMUM_ENTITY_CACHE_TIME
protected final IDataService mSourceDataService
Constructor Detail |
public CachedDataService(IDataService sourceDataService)
Method Detail |
public static void setMinimumTableCacheTime(int minimumTableCacheTime)
public static int getMinimumTableCacheTime()
public static void setMinimumEntityCacheTime(int minimumEntityCacheTime)
public static int getMinimumEntityCacheTime()
public static boolean isTableCachable(IEntityDescriptor entityDescriptor)
public IDataTransaction newTransaction()
IDataService
newTransaction
in interface IDataService
newTransaction
in class AbstractDataService
public boolean ping()
ping
in interface IService
ping
in class AbstractDataService
public void resetCache()
public void unloadEntityTable(IEntityDescriptor entityDescriptor)
public void cacheEntityTable(IEntityDescriptor entityDescriptor)
public IDataService getSourceDataService()
public boolean isTableCached(IEntityDescriptor entityDescriptor)
protected ISelection getCachedEntityTable(IEntityDescriptor entityDescriptor)
public boolean isQualifierProcessable(Qualifier qualifier, IEntityDescriptor entityDescriptor)
protected void loadEntityFromCache(Qualifier qualifier, IEntity targetEntity)
protected void loadSelectionFromCache(IEntityDescriptor entityDescriptor, Qualifier qualifier, ISelection targetSelection)
protected void loadSelectionFromCache(DataQuery dataQuery, ISelection targetSelection)
protected void refreshCachedEntity(IEntity entity)
protected void deleteCachedEntity(IEntity entity)
protected boolean loadEntityFromQueryList(Qualifier qualifier, IEntity targetEntity)
protected void addToQueryList(IEntity entity)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |