use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class PartitionedRegion method setCustomEntryIdleTimeout.
/**
* Changes the CustomExpiry for idleTimeout for values in the region
*
* @param custom the new CustomExpiry
* @return the old CustomExpiry
*/
@Override
public CustomExpiry setCustomEntryIdleTimeout(CustomExpiry custom) {
CustomExpiry expiry = super.setCustomEntryIdleTimeout(custom);
// Set to Bucket regions as well
if (this.getDataStore() != null) {
// not for accessors
for (Object o : this.getDataStore().getAllLocalBuckets()) {
Map.Entry entry = (Map.Entry) o;
Region bucketRegion = (Region) entry.getValue();
bucketRegion.getAttributesMutator().setCustomEntryIdleTimeout(custom);
}
}
return expiry;
}
use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class RegionAttributesCreation method setCustomEntryIdleTimeout.
public CustomExpiry setCustomEntryIdleTimeout(CustomExpiry custom) {
CustomExpiry old = this.customEntryIdleTimeout;
this.customEntryIdleTimeout = custom;
setHasCustomEntryIdleTimeout(true);
return old;
}
use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class RegionAttributesCreation method setCustomEntryTimeToLive.
public CustomExpiry setCustomEntryTimeToLive(CustomExpiry custom) {
CustomExpiry old = this.customEntryTimeToLive;
this.customEntryTimeToLive = custom;
setHasCustomEntryTimeToLive(true);
return old;
}
use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class AbstractRegion method setCustomEntryTimeToLive.
@Override
public CustomExpiry setCustomEntryTimeToLive(CustomExpiry custom) {
checkReadiness();
if (custom != null && !this.statisticsEnabled) {
throw new IllegalStateException(LocalizedStrings.AbstractRegion_CANNOT_SET_CUSTOM_TIME_TO_LIVE_WHEN_STATISTICS_ARE_DISABLED.toLocalizedString());
}
CustomExpiry old = getCustomEntryTimeToLive();
this.customEntryTimeToLive = custom;
updateEntryExpiryPossible();
timeToLiveChanged(getEntryTimeToLive());
return old;
}
use of org.apache.geode.cache.CustomExpiry in project geode by apache.
the class CacheXmlParser method endCustomExpiry.
private void endCustomExpiry() {
Declarable d = createDeclarable();
if (!(d instanceof CustomExpiry)) {
throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_IS_NOT_AN_INSTANCE_OF_CUSTOMEXPIRY.toLocalizedString(d.getClass().getName()));
}
stack.push(d);
}
Aggregations