Package org.apache.openjpa.datacache
Class DefaultCacheDistributionPolicy
- java.lang.Object
-
- org.apache.openjpa.datacache.DefaultCacheDistributionPolicy
-
- All Implemented Interfaces:
CacheDistributionPolicy,Configurable
- Direct Known Subclasses:
TypeBasedCacheDistributionPolicy
public class DefaultCacheDistributionPolicy extends java.lang.Object implements CacheDistributionPolicy
A default implementation that selects the cache by the type of the given managed instance. The name of the cache is determined byname as specifiedby the metadata.- See Also:
ClassMetaData.getDataCacheName()
-
-
Constructor Summary
Constructors Constructor Description DefaultCacheDistributionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendConfiguration()Invoked upon completion of bean property configuration for this object.java.lang.StringselectCache(OpenJPAStateManager sm, java.lang.Object context)Selects the name of the cache where the given managed proxy object state be cached.voidsetConfiguration(Configuration conf)Invoked prior to setting bean properties.voidstartConfiguration()Invoked before bean property configuration is begun on this object.
-
-
-
Method Detail
-
selectCache
public java.lang.String selectCache(OpenJPAStateManager sm, java.lang.Object context)
Description copied from interface:CacheDistributionPolicySelects the name of the cache where the given managed proxy object state be cached.- Specified by:
selectCachein interfaceCacheDistributionPolicy- Parameters:
sm- the managed proxy object to be cached. The actual managed instance can be accessed from the proxy instance simply assm.getManagedInstance().context- the context of invocation. No specific semantics is attributed currently. Can be null.- Returns:
- name of the cache or null, implying that that the instance should not be cached.
-
endConfiguration
public void endConfiguration()
Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
setConfiguration
public void setConfiguration(Configuration conf)
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()
Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
-