Search in sources :

Example 1 with CustomExpiry

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;
}
Also used : Region(org.apache.geode.cache.Region) DumpB2NRegion(org.apache.geode.internal.cache.partitioned.DumpB2NRegion) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) ConcurrentMap(java.util.concurrent.ConcurrentMap) HashMap(java.util.HashMap) CustomExpiry(org.apache.geode.cache.CustomExpiry)

Example 2 with CustomExpiry

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;
}
Also used : CustomExpiry(org.apache.geode.cache.CustomExpiry)

Example 3 with CustomExpiry

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;
}
Also used : CustomExpiry(org.apache.geode.cache.CustomExpiry)

Example 4 with CustomExpiry

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;
}
Also used : CustomExpiry(org.apache.geode.cache.CustomExpiry)

Example 5 with CustomExpiry

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);
}
Also used : Declarable(org.apache.geode.cache.Declarable) CacheXmlException(org.apache.geode.cache.CacheXmlException) CustomExpiry(org.apache.geode.cache.CustomExpiry)

Aggregations

CustomExpiry (org.apache.geode.cache.CustomExpiry)7 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 Region (org.apache.geode.cache.Region)2 DumpB2NRegion (org.apache.geode.internal.cache.partitioned.DumpB2NRegion)2 CacheXmlException (org.apache.geode.cache.CacheXmlException)1 Declarable (org.apache.geode.cache.Declarable)1