Exemplo n.º 1
0
  // Javadoc inherited.
  public Cacheability getCacheability() {

    Cacheability cacheability = Cacheability.CACHEABLE;
    for (int i = 0; i < dependencies.length && cacheability == Cacheability.CACHEABLE; i++) {
      Dependency dependency = dependencies[i];
      cacheability = dependency.getCacheability();
    }
    return cacheability;
  }
Exemplo n.º 2
0
  public Period getTimeToLive() {
    Period min = Period.INDEFINITELY;
    for (int i = 0; i < dependencies.length && Comparator.NE.compare(min, Period.ZERO); i++) {
      Dependency dependency = dependencies[i];
      Period timeToLive = dependency.getTimeToLive();
      min = Period.min(timeToLive, min);
    }

    return min;
  }
Exemplo n.º 3
0
  public Freshness revalidate(DependencyContext context) {

    Freshness aggregate = Freshness.FRESH;
    for (int i = 0; i < dependencies.length && aggregate != Freshness.STALE; i++) {

      Dependency dependency = dependencies[i];
      Freshness freshness = dependency.revalidate(context);
      aggregate = aggregate.combine(freshness);
    }

    return aggregate;
  }