protected static class ExpirationConfiguration.ExpirationPolicyMetaData extends Object implements ExpirationConfiguration.ExpirationPolicyConfigurer
ExpirationConfiguration.ExpirationPolicyMetaData
is a ExpirationConfiguration.ExpirationPolicyConfigurer
implementation that encapsulates
the expiration configuration meta-data (e.g. expiration timeout and action) necessary to configure
a Regions's
expiration policy and behavior.
This class is meant to capture the expiration configuration meta-data specified in the EnableExpiration.ExpirationPolicy
nested annotation in the application-level EnableExpiration
annotation.Modifier and Type | Field and Description |
---|---|
protected static String[] |
ALL_REGIONS |
Modifier | Constructor and Description |
---|---|
protected |
ExpirationPolicyMetaData(org.apache.geode.cache.ExpirationAttributes expirationAttributes,
Set<String> regionNames,
Set<EnableExpiration.ExpirationType> types)
Constructs an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with the given expiration policy
configuraiton meta-data and Region expiration settings. |
protected |
ExpirationPolicyMetaData(int timeout,
ExpirationActionType action,
Set<String> regionNames,
Set<EnableExpiration.ExpirationType> types)
Constructs an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with the given expiration policy
configuraiton meta-data and Region expiration settings. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
accepts(Object regionFactoryBean)
Determines whether the given
Object (e.g. |
protected boolean |
accepts(Supplier<String> regionName)
Determines whether to apply this expiration policy to the given
Region identified by name. |
Object |
configure(Object regionFactoryBean)
Configures the expiration policy for the given
Region . |
protected org.apache.geode.cache.ExpirationAttributes |
defaultExpirationAttributes()
Returns the default, fallback
ExpirationAttributes . |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
from(AnnotationAttributes expirationPolicyAttributes)
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given AnnotationAttributes from the nested EnableExpiration.ExpirationPolicy annotation
specified in an application-level EnableExpiration annotation. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
from(EnableExpiration.ExpirationPolicy expirationPolicy)
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given attribute values from the nested EnableExpiration.ExpirationPolicy annotation specified in
an application-level EnableExpiration annotation. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
fromDefaults()
Factory method to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData using default expiration policy
settings. |
protected boolean |
isIdleTimeout()
Determines whether Idle Timeout Expiration (TTI) was configured for this expiration policy.
|
protected boolean |
isTimeToLive()
Determines whether Time-To-Live Expiration (TTL) was configured for this expiration policy.
|
protected static org.apache.geode.cache.ExpirationAttributes |
newExpirationAttributes(int timeout,
org.apache.geode.cache.ExpirationAction action)
Factory method used to construct a new instance of the
ExpirationAttributes initialized with
the given expiration timeout and action that is taken when an Region entry times out. |
protected static org.apache.geode.cache.ExpirationAttributes |
newExpirationAttributes(int timeout,
ExpirationActionType action)
Factory method used to construct a new instance of the
ExpirationAttributes initialized with
the given expiration timeout and action that is taken when an Region entry times out. |
protected static ExpirationConfiguration.ExpirationPolicyMetaData |
newExpirationPolicyMetaData(int timeout,
ExpirationActionType action,
String[] regionNames,
EnableExpiration.ExpirationType[] types)
Factory method used to construct an instance of
ExpirationConfiguration.ExpirationPolicyMetaData initialized with
the given expiration policy meta-data. |
protected static ExpirationActionType |
resolveAction(ExpirationActionType action)
Resolves the
ExpirationAction used in the expiration policy. |
protected String |
resolveRegionName(Object regionFactoryBean)
Resolves the name of a given
Region from the corresponding ResolvableRegionFactoryBean object. |
protected static int |
resolveTimeout(int timeout)
Resolves the expiration timeout used in the expiration policy.
|
protected ExpiringRegionFactoryBean<?,?> |
setExpirationAttributes(ExpiringRegionFactoryBean<?,?> regionFactoryBean)
Configures the Expiration policies on the targeted
ExpiringRegionFactoryBean , which may be
either a PeerRegionFactoryBean or ClientRegionFactoryBean . |
protected static final String[] ALL_REGIONS
protected ExpirationPolicyMetaData(int timeout, ExpirationActionType action, Set<String> regionNames, Set<EnableExpiration.ExpirationType> types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
configuraiton meta-data and Region
expiration settings.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behavior (TTI/TTL) configured for the Region
.IllegalArgumentException
- if the EnableExpiration.ExpirationType
Set
is empty.EnableExpiration.ExpirationType
,
ExpirationActionType
,
#ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
,
newExpirationAttributes(int, ExpirationActionType)
,
resolveAction(ExpirationActionType)
,
resolveTimeout(int)
protected ExpirationPolicyMetaData(org.apache.geode.cache.ExpirationAttributes expirationAttributes, Set<String> regionNames, Set<EnableExpiration.ExpirationType> types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
configuraiton meta-data and Region
expiration settings.expirationAttributes
- ExpirationAttributes
specifying the expiration timeout in seconds
and expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behaviors (TTI/TTL) configured for the Region
.IllegalArgumentException
- if the EnableExpiration.ExpirationType
Set
is empty.EnableExpiration.ExpirationType
,
ExpirationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData from(AnnotationAttributes expirationPolicyAttributes)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given AnnotationAttributes
from the nested EnableExpiration.ExpirationPolicy
annotation
specified in an application-level EnableExpiration
annotation.expirationPolicyAttributes
- AnnotationAttributes
from a EnableExpiration.ExpirationPolicy
annotation.ExpirationConfiguration.ExpirationPolicyMetaData
initialized from
EnableExpiration.ExpirationPolicy
AnnotationAttributes
.IllegalArgumentException
- if AnnotationAttributes.annotationType()
is not assignable to
EnableExpiration.ExpirationPolicy
.#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
,
AnnotationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData from(EnableExpiration.ExpirationPolicy expirationPolicy)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given attribute values from the nested EnableExpiration.ExpirationPolicy
annotation specified in
an application-level EnableExpiration
annotation.expirationPolicy
- EnableExpiration.ExpirationPolicy
annotation containing the attribute values
used to initialize the ExpirationConfiguration.ExpirationPolicyMetaData
instance.ExpirationConfiguration.ExpirationPolicyMetaData
initialized from
EnableExpiration.ExpirationPolicy
attributes values.EnableExpiration.ExpirationPolicy
,
#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
protected static ExpirationConfiguration.ExpirationPolicyMetaData fromDefaults()
ExpirationConfiguration.ExpirationPolicyMetaData
using default expiration policy
settings.#newExpirationPolicyMetaData(int, ExpirationActionType, String[], ExpirationType[])
protected static org.apache.geode.cache.ExpirationAttributes newExpirationAttributes(int timeout, ExpirationActionType action)
ExpirationAttributes
initialized with
the given expiration timeout and action that is taken when an Region
entry times out.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action to take when the Region
entry times out.ExpirationAttributes
initialized with the given expiration timeout
and action.ExpirationAttributes
,
newExpirationAttributes(int, ExpirationAction)
protected static org.apache.geode.cache.ExpirationAttributes newExpirationAttributes(int timeout, org.apache.geode.cache.ExpirationAction action)
ExpirationAttributes
initialized with
the given expiration timeout and action that is taken when an Region
entry times out.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action to take when the Region
entry times out.ExpirationAttributes
initialized with the given expiration timeout
and action.ExpirationAttributes
protected static ExpirationConfiguration.ExpirationPolicyMetaData newExpirationPolicyMetaData(int timeout, ExpirationActionType action, String[] regionNames, EnableExpiration.ExpirationType[] types)
ExpirationConfiguration.ExpirationPolicyMetaData
initialized with
the given expiration policy meta-data.timeout
- int value indicating the expiration timeout in seconds.action
- expiration action taken when the Region
entry expires.regionNames
- names of Regions
configured with the expiration policy meta-data.types
- type of expiration algorithm/behavior (TTI/TTL) configured for the Region
.ExpirationConfiguration.ExpirationPolicyMetaData
initialized with the given expiration policy
meta-data.IllegalArgumentException
- if the EnableExpiration.ExpirationType
array is empty.EnableExpiration.ExpirationType
,
ExpirationActionType
,
#ExpirationPolicyMetaData(ExpirationAttributes, Set, Set)
,
newExpirationAttributes(int, ExpirationActionType)
protected static ExpirationActionType resolveAction(ExpirationActionType action)
ExpirationAction
used in the expiration policy. Defaults to
ExpirationActionType.INVALIDATE
if action
is null.action
- given ExpirationActionType
to evaluate.ExpirationActionType
or the default if action
is null.ExpirationActionType
protected static int resolveTimeout(int timeout)
timeout
is less than 0.timeout
- int value expressing the expiration timeout in seconds.protected boolean accepts(Object regionFactoryBean)
Object
(e.g. Spring bean) is accepted for Eviction policy configuration.regionFactoryBean
- Object
being evaluated as an Eviction policy configuration candidate.Object
is accepted for Eviction policy configuration.ExpirationConfiguration.isRegionFactoryBean(Object)
,
resolveRegionName(Object)
,
accepts(Supplier)
protected boolean accepts(Supplier<String> regionName)
Region
identified by name.regionName
- name of the Region
to evaluate.Region
identified by name.protected boolean isIdleTimeout()
protected boolean isTimeToLive()
protected String resolveRegionName(Object regionFactoryBean)
Region
from the corresponding ResolvableRegionFactoryBean
object.regionFactoryBean
- ResolvableRegionFactoryBean
from which to resolve the Region
name.Region
created from the given ResolvableRegionFactoryBean
.ResolvableRegionFactoryBean.resolveRegionName()
protected ExpiringRegionFactoryBean<?,?> setExpirationAttributes(ExpiringRegionFactoryBean<?,?> regionFactoryBean)
ExpiringRegionFactoryBean
, which may be
either a PeerRegionFactoryBean
or ClientRegionFactoryBean
.regionFactoryBean
- ExpiringRegionFactoryBean
to configure.ExpiringRegionFactoryBean
.AnnotationBasedExpiration.forIdleTimeout(ExpirationAttributes)
,
AnnotationBasedExpiration.forTimeToLive(ExpirationAttributes)
,
ExpiringRegionFactoryBean
,
defaultExpirationAttributes()
public Object configure(Object regionFactoryBean)
ExpirationConfiguration.ExpirationPolicyConfigurer
Region
.configure
in interface ExpirationConfiguration.ExpirationPolicyConfigurer
regionFactoryBean
- Region
object who's expiration policy will be configured.Region
object.Region
protected org.apache.geode.cache.ExpirationAttributes defaultExpirationAttributes()
ExpirationAttributes
.ExpirationAttributes
containing the defaults.ExpirationAttributes
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.