org.apache.openjpa.datacache
public class DataCacheManagerImpl extends java.lang.Object implements Closeable, DataCacheManager
| Constructor and Description |
|---|
DataCacheManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close all caches.
|
ClearableScheduler |
getClearableScheduler()
Return the runnable which schedules evictions.
|
DataCache |
getDataCache(java.lang.String name)
Return the named data cache, or null if it does not exist.
|
DataCache |
getDataCache(java.lang.String name,
boolean create)
Returns the named cache.
|
CacheDistributionPolicy |
getDistributionPolicy()
Gets the instance-based cache distribution policy, if configured.
|
DataCachePCDataGenerator |
getPCDataGenerator()
Return the PCData generator if configured.
|
DataCache |
getSystemDataCache()
Return the system-wide data cache, or null if caching is not enabled.
|
QueryCache |
getSystemQueryCache()
Return the system query cache, or null if not configured.
|
void |
initialize(OpenJPAConfiguration conf,
ObjectValue dataCache,
ObjectValue queryCache)
Initialize the manager, supplying the cache configuration.
|
boolean |
isCachable(ClassMetaData meta)
Affirms if the given type is eligible for cache.
|
DataCache |
selectCache(OpenJPAStateManager sm)
Select cache for the given managed instance.
|
void |
setTypes(java.util.Set<java.lang.String> includedTypes,
java.util.Set<java.lang.String> excludedTypes) |
public void initialize(OpenJPAConfiguration conf, ObjectValue dataCache, ObjectValue queryCache)
DataCacheManagerinitialize in interface DataCacheManagerpublic DataCache getSystemDataCache()
DataCacheManagergetSystemDataCache in interface DataCacheManagerpublic DataCache getDataCache(java.lang.String name)
DataCacheManagergetDataCache in interface DataCacheManagerpublic DataCache getDataCache(java.lang.String name, boolean create)
getDataCache in interface DataCacheManagercreate - if true, the cache will be created if it does
not already existpublic QueryCache getSystemQueryCache()
DataCacheManagergetSystemQueryCache in interface DataCacheManagerpublic DataCachePCDataGenerator getPCDataGenerator()
DataCacheManagergetPCDataGenerator in interface DataCacheManagerpublic ClearableScheduler getClearableScheduler()
DataCacheManagergetClearableScheduler in interface DataCacheManagerpublic void close()
DataCacheManagerclose in interface DataCacheManagerclose in interface Closeablepublic DataCache selectCache(OpenJPAStateManager sm)
selectCache in interface DataCacheManagersm - the managed proxy instancepublic CacheDistributionPolicy getDistributionPolicy()
getDistributionPolicy in interface DataCacheManagerpublic boolean isCachable(ClassMetaData meta)
public void setTypes(java.util.Set<java.lang.String> includedTypes,
java.util.Set<java.lang.String> excludedTypes)