/** * When a <code>entry-idle-time</code> element is finished, an optional * Declarable (the custom-expiry) is followed by the * {@link ExpirationAttributes} are on top of the stack followed by the * {@link RegionAttributesCreation} to which the expiration attributes are * assigned. */ private void endEntryIdleTime() { 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).setEntryIdleTimeout(expire); // } else if (a instanceof RegionAttributesCreation) { ((RegionAttributesCreation)a).setEntryIdleTimeout(expire); if (custom != null) { ((RegionAttributesCreation)a).setCustomEntryIdleTimeout((CustomExpiry)custom); } } else { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_MUST_BE_DEFINED_IN_THE_CONTEXT_OF_REGIONATTRIBUTES_OR_PARTITIONATTRIBUTES.toLocalizedString(ENTRY_IDLE_TIME)); } }
/** * When a <code>entry-idle-time</code> element is finished, an optional * Declarable (the custom-expiry) is followed by the * {@link ExpirationAttributes} are on top of the stack followed by the * {@link RegionAttributesCreation} to which the expiration attributes are * assigned. */ private void endEntryIdleTime() { 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).setEntryIdleTimeout(expire); // } else if (a instanceof RegionAttributesCreation) { ((RegionAttributesCreation)a).setEntryIdleTimeout(expire); if (custom != null) { ((RegionAttributesCreation)a).setCustomEntryIdleTimeout((CustomExpiry)custom); } } else { throw new CacheXmlException(LocalizedStrings.CacheXmlParser_A_0_MUST_BE_DEFINED_IN_THE_CONTEXT_OF_REGIONATTRIBUTES_OR_PARTITIONATTRIBUTES.toLocalizedString(ENTRY_IDLE_TIME)); } }
attrs.setCustomEntryIdleTimeout(getCustomEntryIdleTimeoutInstance());
attrs.setLoadFactor(42.42f); attrs.setStatisticsEnabled(true); attrs.setCustomEntryIdleTimeout(new Expiry1()); attrs.setCustomEntryTimeToLive(new Expiry5()); attrs.setInitialCapacity(242); attrs.setStatisticsEnabled(true); attrs.setCustomEntryIdleTimeout(new Expiry2()); attrs.setLoadFactor(43.43f); attrs.setStatisticsEnabled(true); attrs.setCustomEntryIdleTimeout(new Expiry3()); attrs.setCustomEntryTimeToLive(new Expiry4());
setCustomEntryIdleTimeout(parent.getCustomEntryIdleTimeout());
setCustomEntryIdleTimeout(parent.getCustomEntryIdleTimeout());