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 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 by name as specified by
the metadata.
- See Also:
ClassMetaData.getDataCacheName()
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultCacheDistributionPolicy
public DefaultCacheDistributionPolicy()
selectCache
public String selectCache(OpenJPAStateManager sm,
Object context)
- Description copied from interface:
CacheDistributionPolicy
- Selects the name of the cache where the given managed proxy object state be cached.
- Specified by:
selectCache in interface CacheDistributionPolicy
- Parameters:
sm - the managed proxy object to be cached. The actual managed instance can be accessed from the proxy
instance simply as sm.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()
- Specified by:
endConfiguration in interface Configurable
setConfiguration
public void setConfiguration(Configuration conf)
- Specified by:
setConfiguration in interface Configurable
startConfiguration
public void startConfiguration()
- Specified by:
startConfiguration in interface Configurable
Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.