|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.inb.biomoby.central.cache.CacheConfig
public class CacheConfig
BioMoby Registry cache implementation. By default a cache location is in a $HOME/.MobyCentralCache/ directory, but may be overriden by providing a custom implementation of IMobyCentralCache interface.
| Method Summary | ||
|---|---|---|
static CacheConfig |
instance()
A singleton instance creator. |
|
boolean |
isCached()
Method to check whether a cache must be used |
|
|
load(MobyCentral central,
String file)
Generic method to load BioMoby entities from a cache. |
|
|
load(Reader reader)
Generic method to load BioMoby entities from a cache. |
|
|
save(List<T> entities,
MobyCentral central,
String file)
Generic method that saves any BioMoby entities ("Namespace", "Service", "ServiceType" and "ObjectType") to a cache file. |
|
|
save(List<T> entities,
Writer writer)
Generic method to save BioMoby entities to the provided writer |
|
void |
setCache(IMobyCentralCache cache)
Method allows override a default cache location. |
|
void |
setCached(boolean isCached)
Method to mark that a cache must be used. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public boolean isCached()
public void setCached(boolean isCached)
isCached - - true to enable a cache, false otherwisepublic void setCache(IMobyCentralCache cache)
cache - - a custom cache implementation
public <T extends AbstractEntity> void save(List<T> entities,
MobyCentral central,
String file)
throws Exception
T - - the entity type to saveentities - - the list of entities to be savedcentral - - a BioMoby registry the cache belongs tofile - - a file name entities to be saved (for instance "MobyServiceList" ...)
Exception
public <T extends AbstractEntity> void save(List<T> entities,
Writer writer)
throws Exception
T - - the entity type to saveentities - - the list of entities to be savedwriter - - the writer where entities are saved
Exception
public <T extends AbstractEntity> List<T> load(MobyCentral central,
String file)
throws Exception
T - - the entity type to be load from the cachecentral - - a BioMoby registry the cache belongs tofile - - file name from which to load entities
Exception
public <T extends AbstractEntity> List<T> load(Reader reader)
throws Exception
T - - the entity type to be load from the cachereader - - a reader to load entities from.
Exceptionpublic static CacheConfig instance()
|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||