private void applyDefaultsToElementWithoutLifespanSet(Element element) { if (!element.isLifespanSet()) { element.setLifespanDefaults(TimeUtil.convertTimeToInt(configuration.getTimeToIdleSeconds()), TimeUtil.convertTimeToInt(configuration.getTimeToLiveSeconds()), configuration.isEternal()); } }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * <p> * This method in addition propogates the default TTI/TTL values of the supplied cache into this element. * * @param config config to take default parameters from * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired(CacheConfiguration config) { if (cacheDefaultLifespan) { if (config.isEternal()) { timeToIdle = 0; timeToLive = 0; } else { timeToIdle = TimeUtil.convertTimeToInt(config.getTimeToIdleSeconds()); timeToLive = TimeUtil.convertTimeToInt(config.getTimeToLiveSeconds()); } } return isExpired(); }
private void applyDefaultsToElementWithoutLifespanSet(Element element) { if (!element.isLifespanSet()) { element.setLifespanDefaults(TimeUtil.convertTimeToInt(configuration.getTimeToIdleSeconds()), TimeUtil.convertTimeToInt(configuration.getTimeToLiveSeconds()), configuration.isEternal()); } }
private void applyDefaultsToElementWithoutLifespanSet(Element element) { if (!element.isLifespanSet()) { element.setLifespanDefaults(TimeUtil.convertTimeToInt(configuration.getTimeToIdleSeconds()), TimeUtil.convertTimeToInt(configuration.getTimeToLiveSeconds()), configuration.isEternal()); } }
private void applyDefaultsToElementWithoutLifespanSet(Element element) { if (!element.isLifespanSet()) { element.setLifespanDefaults(TimeUtil.convertTimeToInt(configuration.getTimeToIdleSeconds()), TimeUtil.convertTimeToInt(configuration.getTimeToLiveSeconds()), configuration.isEternal()); } }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * <p> * This method in addition propogates the default TTI/TTL values of the supplied cache into this element. * * @param config config to take default parameters from * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired(CacheConfiguration config) { if (cacheDefaultLifespan) { if (config.isEternal()) { timeToIdle = 0; timeToLive = 0; } else { timeToIdle = TimeUtil.convertTimeToInt(config.getTimeToIdleSeconds()); timeToLive = TimeUtil.convertTimeToInt(config.getTimeToLiveSeconds()); } } return isExpired(); }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * <p> * This method in addition propogates the default TTI/TTL values of the supplied cache into this element. * * @param config config to take default parameters from * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired(CacheConfiguration config) { if (cacheDefaultLifespan) { if (config.isEternal()) { timeToIdle = 0; timeToLive = 0; } else { timeToIdle = TimeUtil.convertTimeToInt(config.getTimeToIdleSeconds()); timeToLive = TimeUtil.convertTimeToInt(config.getTimeToLiveSeconds()); } } return isExpired(); }
/** * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past. * <p> * This method in addition propogates the default TTI/TTL values of the supplied cache into this element. * * @param config config to take default parameters from * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is * considered not able to expire. * @see #getExpirationTime() */ public boolean isExpired(CacheConfiguration config) { if (cacheDefaultLifespan) { if (config.isEternal()) { timeToIdle = 0; timeToLive = 0; } else { timeToIdle = TimeUtil.convertTimeToInt(config.getTimeToIdleSeconds()); timeToLive = TimeUtil.convertTimeToInt(config.getTimeToLiveSeconds()); } } return isExpired(); }