Package org.apache.openjpa.datacache
Class DefaultCacheDistributionPolicy
java.lang.Object
org.apache.openjpa.datacache.DefaultCacheDistributionPolicy
- All Implemented Interfaces:
CacheDistributionPolicy
,Configurable
- Direct Known Subclasses:
TypeBasedCacheDistributionPolicy
A default implementation that selects the cache by the type of the given managed instance.
The name of the cache is determined by
name as specified
by
the metadata.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked upon completion of bean property configuration for this object.selectCache
(OpenJPAStateManager sm, Object context) Selects the name of the cache where the given managed proxy object state be cached.void
Invoked prior to setting bean properties.void
Invoked before bean property configuration is begun on this object.
-
Constructor Details
-
DefaultCacheDistributionPolicy
public DefaultCacheDistributionPolicy()
-
-
Method Details
-
selectCache
Description copied from interface:CacheDistributionPolicy
Selects the name of the cache where the given managed proxy object state be cached.- Specified by:
selectCache
in 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:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
-
setConfiguration
Description copied from interface:Configurable
Invoked prior to setting bean properties.- Specified by:
setConfiguration
in interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:Configurable
Invoked before bean property configuration is begun on this object.- Specified by:
startConfiguration
in interfaceConfigurable
-