docs: public void setTimeoutByInterval(int type, long interval)
      {
          if (ivTimeoutType != CURRENT_TIME)
          {
              // If the keys has expired, and is not in use, then allow the
              // time out time to be reset, and the bean re-loaded.           d210290
              if (ivExpired == true &&
                  ivDiscarded == false &&
                  ivInUse == false)
              {
                  ivExpired = false;
                  ivTimeout = System.currentTimeMillis();
              }
              else
                  throw new IllegalStateException("timeout already set");
          }
  
          long now = ivTimeout; // Save the 'current' time
  
          ivTimeoutType = TIMEOUT_TIME;
          ivInUse = true; // d210290
  
          switch (type)
          {
          // The specified 'interval' is the basic interval specification
          // indicating to 'reload the bean every so many minutes'...
          // which means that the bean must be loaded the first time it
          // is accessed in any given interval, where the start of the
          // first interval is midnight, January 1, 1970 UTC, and each
          // interval duration is the specified interval value.
          // By determining the bean timeout in this way, rather than just
          // adding the interval to the current time, consistent data access
          // may be obtained across cluster members.
          // Also, to avoid all beans with the same interval value ending up
          // with the same timeout, vary it by adding in an offset that is
          // reproducable across servers... simply use the hash code to
          // obtain an index over the interval in milliseconds.            d217712
              case BeanMetaData.CACHE_RELOAD_INTERVAL:
                  if (interval > 0)
                  {
                      long currOffset = now % interval;
                      long hashOffset = (ivBeanId.hashCode() & 0x7FFFFFFF) % interval;
                      ivTimeout = now + (hashOffset - currOffset);
                      if (ivTimeout <= now) // d232681
                          ivTimeout += interval;
                  }
                  else
                  {
                      ivTimeout = Long.MAX_VALUE;
                  }
                  break;
  
              // The specified 'interval' is for reloading the bean at a specific
              // time every day... and the 'interval' value is the number of
              // milliseconds from midnight to that time, so just add it to
              // the time in milliseconds representing midnight.
              case BeanMetaData.CACHE_RELOAD_DAILY:
                  GregorianCalendar today = new GregorianCalendar();
                  today.set(GregorianCalendar.HOUR_OF_DAY, 0);
                  today.set(GregorianCalendar.MINUTE, 0);
                  today.set(GregorianCalendar.SECOND, 0);
                  today.set(GregorianCalendar.MILLISECOND, 0);
                  long midnight = today.getTime().getTime();
                  ivTimeout = midnight + interval;
  
                  // If this calculated timeout has already passed, add 24 hours to it.
                  // For example, if DAILY indicates "3am" and "now" is "3:15am", the
                  // entry will live until 3am tomorrow.
                  if (ivTimeout <= now) // d232681
                  {
                      ivTimeout += 24 * 60 * 60 * 1000; // 24 hours in milliseconds
                  }
                  break;
  
              // The specified 'interval' is for reloading the bean at a specific
              // time and day of every week... and the 'interval' value is the
              // number of milliseconds from midnight on Sunday to that time,
              // so just add it to the time in milliseconds representing midnight
              // on Sunday (i.e. early Sunday morning).
              case BeanMetaData.CACHE_RELOAD_WEEKLY:
                  GregorianCalendar sunday = new GregorianCalendar();
                  sunday.set(GregorianCalendar.DAY_OF_WEEK, GregorianCalendar.SUNDAY);
                  sunday.set(GregorianCalendar.HOUR_OF_DAY, 0);
                  sunday.set(GregorianCalendar.MINUTE, 0);
                  sunday.set(GregorianCalendar.SECOND, 0);
                  sunday.set(GregorianCalendar.MILLISECOND, 0);
                  long midnightSunday = sunday.getTime().getTime();
                  ivTimeout = midnightSunday + interval;
  
                  // If this calculated timeout has already passed, add 7 days to it.
                  // For example, if WEEKLY indicates "Monday 3am" and "now" is
                  // "Tuesday 2:30am", the entry will live until next Monday 3am.
                  if (ivTimeout <= now) // d232681
                  {
                      ivTimeout += 7 * 24 * 60 * 60 * 1000; // 7 days in milliseconds
                  }
                  break;
  
              default:
                  throw new IllegalArgumentException("Interval LoadPolicy not specified");
          }
      }