/** * When a <code>entry-time-to-live</code> element is finished, an optional * Declarable (the custom-expiry) is followed by the * {@link ExpirationAttributes} are on top of the stack followed by either the * {@link RegionAttributesCreation} to which the expiration attributes are * assigned, or the attributes for a {@link PartitionAttributes} to which the attributes are * assigned. */ private void endEntryTimeToLive() { Declarable custom = null; if (stack.peek() instanceof Declarable) { custom = (Declarable)stack.pop(); } ExpirationAttributes expire = (ExpirationAttributes) stack.pop(); Object a = stack.peek(); // if (a instanceof PartitionAttributesFactory) { // ((PartitionAttributesFactory) a).setEntryTimeToLive(expire); // } else if (a instanceof RegionAttributesCreation) { ((RegionAttributesCreation)a).setEntryTimeToLive(expire); if (custom != null) { ((RegionAttributesCreation)a).setCustomEntryTimeToLive((CustomExpiry)custom); } } else { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_MUST_BE_DEFINED_IN_THE_CONTEXT_OF_REGIONATTRIBUTES_OR_PARTITIONATTRIBUTES.toLocalizedString(ENTRY_TIME_TO_LIVE)); } }
/** * When a <code>entry-time-to-live</code> element is finished, an optional * Declarable (the custom-expiry) is followed by the * {@link ExpirationAttributes} are on top of the stack followed by either the * {@link RegionAttributesCreation} to which the expiration attributes are * assigned, or the attributes for a {@link PartitionAttributes} to which the attributes are * assigned. */ private void endEntryTimeToLive() { Declarable custom = null; if (stack.peek() instanceof Declarable) { custom = (Declarable)stack.pop(); } ExpirationAttributes expire = (ExpirationAttributes) stack.pop(); Object a = stack.peek(); // if (a instanceof PartitionAttributesFactory) { // ((PartitionAttributesFactory) a).setEntryTimeToLive(expire); // } else if (a instanceof RegionAttributesCreation) { ((RegionAttributesCreation)a).setEntryTimeToLive(expire); if (custom != null) { ((RegionAttributesCreation)a).setCustomEntryTimeToLive((CustomExpiry)custom); } } else { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_MUST_BE_DEFINED_IN_THE_CONTEXT_OF_REGIONATTRIBUTES_OR_PARTITIONATTRIBUTES.toLocalizedString(ENTRY_TIME_TO_LIVE)); } }
attrs.setCustomEntryTimeToLive(getCustomEntryTimeToLiveInstance());
attrs.setStatisticsEnabled(true); attrs.setCustomEntryIdleTimeout(new Expiry1()); attrs.setCustomEntryTimeToLive(new Expiry5()); attrs.setStatisticsEnabled(true); attrs.setCustomEntryIdleTimeout(new Expiry3()); attrs.setCustomEntryTimeToLive(new Expiry4());
setCustomEntryTimeToLive(parent.getCustomEntryTimeToLive());
setCustomEntryTimeToLive(parent.getCustomEntryTimeToLive());