public class OnChangeEvictingCache extends java.lang.Object implements IResourceScopeCache
execWithoutCacheClear(Resource, IUnitOfWork)
or execWithTemporaryCaching(Resource, IUnitOfWork)
.Modifier and Type | Class and Description |
---|---|
static class |
OnChangeEvictingCache.CacheAdapter |
static interface |
OnChangeEvictingCache.Listener
A simple cache listener.
|
IResourceScopeCache.NullImpl
Constructor and Description |
---|
OnChangeEvictingCache() |
Modifier and Type | Method and Description |
---|---|
protected void |
cacheHit(OnChangeEvictingCache.CacheAdapter adapter)
Announce a cache hit for the internal statistics of the adapter.
|
protected void |
cacheMiss(OnChangeEvictingCache.CacheAdapter adapter)
Announce a cache miss for the internal statistics of the adapter.
|
void |
clear(org.eclipse.emf.ecore.resource.Resource resource)
Clears the cache of the given resource.
|
<Result,Param extends org.eclipse.emf.ecore.resource.Resource> |
execWithoutCacheClear(Param resource,
IUnitOfWork<Result,Param> transaction)
The transaction will be executed.
|
<Result,Param extends org.eclipse.emf.ecore.resource.Resource> |
execWithTemporaryCaching(Param resource,
IUnitOfWork<Result,Param> transaction)
The transaction will be executed with caching enabled.
|
<T> T |
get(java.lang.Object key,
org.eclipse.emf.ecore.resource.Resource resource,
com.google.inject.Provider<T> provider)
Try to obtain the value that is cached for the given key in the given resource.
|
OnChangeEvictingCache.CacheAdapter |
getOrCreate(org.eclipse.emf.ecore.resource.Resource resource)
Returns the cache adapter that is associated with the resource.
|
public void clear(org.eclipse.emf.ecore.resource.Resource resource)
clear
in interface IResourceScopeCache
public <T> T get(java.lang.Object key, org.eclipse.emf.ecore.resource.Resource resource, com.google.inject.Provider<T> provider)
get
in interface IResourceScopeCache
resource
- the resource. If it is null
, the provider will be used to compute the value.key
- the cache key. May not be null
.provider
- the strategy to compute the value if necessary. May not be null
.protected void cacheMiss(OnChangeEvictingCache.CacheAdapter adapter)
protected void cacheHit(OnChangeEvictingCache.CacheAdapter adapter)
public OnChangeEvictingCache.CacheAdapter getOrCreate(org.eclipse.emf.ecore.resource.Resource resource)
null
.resource
- the resource. May not be null
.null
.public <Result,Param extends org.eclipse.emf.ecore.resource.Resource> Result execWithoutCacheClear(Param resource, IUnitOfWork<Result,Param> transaction) throws org.eclipse.emf.common.util.WrappedException
org.eclipse.emf.common.util.WrappedException
public <Result,Param extends org.eclipse.emf.ecore.resource.Resource> Result execWithTemporaryCaching(Param resource, IUnitOfWork<Result,Param> transaction) throws org.eclipse.emf.common.util.WrappedException
org.eclipse.emf.common.util.WrappedException