|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.datacache.DefaultCacheDistributionPolicy org.apache.openjpa.datacache.TypeBasedCacheDistributionPolicy
public class TypeBasedCacheDistributionPolicy
A cache distribution policy based on the type of the managed objects.
The policy is configured by specifying list of included or excluded types.
The lists are specified as fully-qualified persistence class names separated by semicolon.
The policy checks for the given instance by its type whether the class name appears in
exclusion or inclusion lists. If the class name appears in exclusion list then the
instance is not cached. Otherwise, if an inclusion list exists and the class name appears in inclusion list
or @DataCache annotation is specified on the class meta data, then the instance is cached.
Constructor Summary | |
---|---|
TypeBasedCacheDistributionPolicy()
|
Method Summary | |
---|---|
Set<String> |
getExcludedTypes()
Gets the excluded types, if configured. |
Set<String> |
getIncludedTypes()
Gets the included types, if configured. |
String |
selectCache(OpenJPAStateManager sm,
Object context)
Selects the name of the cache where the given managed proxy object state be cached. |
void |
setExcludedTypes(String types)
Sets excluded types from a semicolon separated list of type names. |
void |
setIncludedTypes(String types)
Sets included types from a semicolon separated list of type names. |
Methods inherited from class org.apache.openjpa.datacache.DefaultCacheDistributionPolicy |
---|
endConfiguration, setConfiguration, startConfiguration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.openjpa.lib.conf.Configurable |
---|
endConfiguration, setConfiguration, startConfiguration |
Constructor Detail |
---|
public TypeBasedCacheDistributionPolicy()
Method Detail |
---|
public Set<String> getExcludedTypes()
public void setExcludedTypes(String types)
public Set<String> getIncludedTypes()
public void setIncludedTypes(String types)
public String selectCache(OpenJPAStateManager sm, Object context)
CacheDistributionPolicy
selectCache
in interface CacheDistributionPolicy
selectCache
in class DefaultCacheDistributionPolicy
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |