/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This can be overidden in * {@link net.sf.ehcache.Element} * <p> * This property can be modified dynamically while the cache is operating. * * @param timeToIdleSeconds the default amount of time to live for an element from its last accessed or modified date */ public final void setTimeToIdleSeconds(long timeToIdleSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToIdleSeconds, "timeToIdleSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, 0, timeToIdleSeconds)) { long oldTti = this.timeToIdleSeconds; long newTti = timeToIdleSeconds; this.timeToIdleSeconds = timeToIdleSeconds; fireTtiChanged(oldTti, newTti); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. * This default can be overridden in {@link net.sf.ehcache.Element} * <p> * This property can be modified dynamically while the cache is operating. * * @param timeToLiveSeconds the default amount of time to live for an element from its creation date */ public final void setTimeToLiveSeconds(long timeToLiveSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToLiveSeconds, "timeToLiveSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, timeToLiveSeconds, 0)) { long oldTtl = this.timeToLiveSeconds; long newTtl = timeToLiveSeconds; this.timeToLiveSeconds = timeToLiveSeconds; fireTtlChanged(oldTtl, newTtl); } }
/** * Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default. * * @param eternal true for eternal */ public final void setEternal(boolean eternal) { checkDynamicChange(); isEternalValueConflictingWithTTIOrTTL(eternal, getTimeToLiveSeconds(), getTimeToIdleSeconds()); this.eternal = eternal; if (eternal) { setTimeToIdleSeconds(0); setTimeToLiveSeconds(0); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This can be overidden in * {@link net.sf.ehcache.Element} * <p/> * This property can be modified dynamically while the cache is operating. * * @param timeToIdleSeconds the default amount of time to live for an element from its last accessed or modified date */ public final void setTimeToIdleSeconds(long timeToIdleSeconds) { checkDynamicChange(); if (!isEternalValueConflictingWithTTIOrTTL(eternal, 0, timeToIdleSeconds)) { long oldTti = this.timeToIdleSeconds; long newTti = timeToIdleSeconds; this.timeToIdleSeconds = timeToIdleSeconds; fireTtiChanged(oldTti, newTti); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. * This default can be overridden in {@link net.sf.ehcache.Element} * <p/> * This property can be modified dynamically while the cache is operating. * * @param timeToLiveSeconds the default amount of time to live for an element from its creation date */ public final void setTimeToLiveSeconds(long timeToLiveSeconds) { checkDynamicChange(); if (!isEternalValueConflictingWithTTIOrTTL(eternal, timeToLiveSeconds, 0)) { long oldTtl = this.timeToLiveSeconds; long newTtl = timeToLiveSeconds; this.timeToLiveSeconds = timeToLiveSeconds; fireTtlChanged(oldTtl, newTtl); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This can be overidden in * {@link net.sf.ehcache.Element} * <p> * This property can be modified dynamically while the cache is operating. * * @param timeToIdleSeconds the default amount of time to live for an element from its last accessed or modified date */ public final void setTimeToIdleSeconds(long timeToIdleSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToIdleSeconds, "timeToIdleSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, 0, timeToIdleSeconds)) { long oldTti = this.timeToIdleSeconds; long newTti = timeToIdleSeconds; this.timeToIdleSeconds = timeToIdleSeconds; fireTtiChanged(oldTti, newTti); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This can be overidden in * {@link net.sf.ehcache.Element} * <p/> * This property can be modified dynamically while the cache is operating. * * @param timeToIdleSeconds the default amount of time to live for an element from its last accessed or modified date */ public final void setTimeToIdleSeconds(long timeToIdleSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToIdleSeconds, "timeToIdleSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, 0, timeToIdleSeconds)) { long oldTti = this.timeToIdleSeconds; long newTti = timeToIdleSeconds; this.timeToIdleSeconds = timeToIdleSeconds; fireTtiChanged(oldTti, newTti); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. * This default can be overridden in {@link net.sf.ehcache.Element} * <p> * This property can be modified dynamically while the cache is operating. * * @param timeToLiveSeconds the default amount of time to live for an element from its creation date */ public final void setTimeToLiveSeconds(long timeToLiveSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToLiveSeconds, "timeToLiveSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, timeToLiveSeconds, 0)) { long oldTtl = this.timeToLiveSeconds; long newTtl = timeToLiveSeconds; this.timeToLiveSeconds = timeToLiveSeconds; fireTtlChanged(oldTtl, newTtl); } }
/** * Sets the time to idle for an element before it expires. Is only used if the element is not eternal. * This default can be overridden in {@link net.sf.ehcache.Element} * <p/> * This property can be modified dynamically while the cache is operating. * * @param timeToLiveSeconds the default amount of time to live for an element from its creation date */ public final void setTimeToLiveSeconds(long timeToLiveSeconds) { checkDynamicChange(); verifyGreaterThanOrEqualToZero(timeToLiveSeconds, "timeToLiveSeconds"); if (!isEternalValueConflictingWithTTIOrTTL(eternal, timeToLiveSeconds, 0)) { long oldTtl = this.timeToLiveSeconds; long newTtl = timeToLiveSeconds; this.timeToLiveSeconds = timeToLiveSeconds; fireTtlChanged(oldTtl, newTtl); } }
/** * Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default. * * @param eternal true for eternal */ public final void setEternal(boolean eternal) { checkDynamicChange(); isEternalValueConflictingWithTTIOrTTL(eternal, getTimeToLiveSeconds(), getTimeToIdleSeconds()); this.eternal = eternal; if (eternal) { setTimeToIdleSeconds(0); setTimeToLiveSeconds(0); } }
/** * Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default. * * @param eternal true for eternal */ public final void setEternal(boolean eternal) { checkDynamicChange(); isEternalValueConflictingWithTTIOrTTL(eternal, getTimeToLiveSeconds(), getTimeToIdleSeconds()); this.eternal = eternal; if (eternal) { setTimeToIdleSeconds(0); setTimeToLiveSeconds(0); } }
/** * Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default. * * @param eternal true for eternal */ public final void setEternal(boolean eternal) { checkDynamicChange(); isEternalValueConflictingWithTTIOrTTL(eternal, getTimeToLiveSeconds(), getTimeToIdleSeconds()); this.eternal = eternal; if (eternal) { setTimeToIdleSeconds(0); setTimeToLiveSeconds(0); } }