|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.server.repository.cache.ResourceCache<E>
E - Cache of Resource objectspublic class ResourceCache<E extends CachableResource>
Provides cached loading and creating and state checking of resources. This is an ever growing cache that is only cleared when clear() is called. For our purposes this is after each request so concurrency issues can be handled exclusively by the database.
| Constructor Summary | |
|---|---|
ResourceCache(java.lang.String cacheName,
int cacheSize,
CachableResourceFactory<E> cachableFactory,
RepositoryConnection repositoryConnection)
Create a new ResourceCache |
|
| Method Summary | |
|---|---|
void |
clear()
Clear the cache of ids and resources |
E |
create(java.lang.Long id,
boolean forceCreate)
Create a server object with the given ID |
boolean |
isStored(java.lang.Long id)
Is the a resource with the given ID stored |
E |
load(java.lang.Long id)
Load a resource |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceCache(java.lang.String cacheName,
int cacheSize,
CachableResourceFactory<E> cachableFactory,
RepositoryConnection repositoryConnection)
cacheName - Name of cachecacheSize - Size of object cache to createcachableFactory - Factory to create resourcesrepositoryConnection - RepositoryConnection to query and update database| Method Detail |
|---|
public E load(java.lang.Long id)
throws AnzoException
id - Id of resource
AnzoException
public E create(java.lang.Long id,
boolean forceCreate)
throws AnzoException
id - ID of server objectforceCreate - Force creation of resource if not created
AnzoExceptionpublic boolean isStored(java.lang.Long id)
id - ID of resource
public void clear()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||