Package com.volantis.shared.dependency

Examples of com.volantis.shared.dependency.Dependency


    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;
    }
View Full Code Here


    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;
    }
View Full Code Here

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

            Dependency dependency = dependencies[i];

            // Make sure that the dependency updates the revalidation list
            // correctly.
            Freshness freshness = internal.checkFreshness(dependency);
            aggregate = aggregate.combine(freshness);
View Full Code Here

        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;
    }
View Full Code Here

    public void clearDependencies() {
        dependencies.clear();
    }

    public Dependency extractDependency() {
        Dependency result;
        int count = dependencies.size();
        if (count == 0) {
            result = NO_DEPENDENCY;
        } else if (count == 1) {
            result = (Dependency) dependencies.iterator().next();
        } else {
            result = new Dependencies(dependencies);
        }
        Dependency dependency = result;
        clearDependencies();
        return dependency;
    }
View Full Code Here

        return new DependencyTrackerImpl(this);
    }

    public void propagateDependencies() {
        for (Iterator i = dependencies.iterator(); i.hasNext();) {
            Dependency dependency = (Dependency) i.next();
            containingTracker.addDependency(dependency);
        }
        clearDependencies();
    }
View Full Code Here

                // to the list.
                freshness = Freshness.FRESH;
                for (Iterator i = checked.entrySet().iterator();
                     freshness == Freshness.FRESH && i.hasNext();) {
                    Map.Entry entry = (Map.Entry) i.next();
                    Dependency nested = (Dependency) entry.getKey();
                    freshness = (Freshness) entry.getValue();
                    if (freshness == Freshness.REVALIDATE) {
                        freshness = nested.revalidate(this);
                    }
                }
            }
        } finally {
            checked = null;
View Full Code Here

            public boolean isComplex() {
                return false;
            }
        };
        final Dependency dependency = new FixedTTLDependency(
            SystemClock.getDefaultInstance(), Period.inSeconds(100));
        cache.retrieve(cacheKey, new TestCacheableObjectProvider(
            cache.getRootGroup(), true,
            new CacheBodyOperationProcess.RecordingWithDependency(
                recording, dependency)));
View Full Code Here

            public boolean isComplex() {
                return false;
            }
        };
        final Dependency dependency = new FixedTTLDependency(
            SystemClock.getDefaultInstance(), Period.inSeconds(0));
        cache.retrieve(cacheKey, new TestCacheableObjectProvider(
            cache.getRootGroup(), false,
            new CacheBodyOperationProcess.RecordingWithDependency(
                recording, dependency)));
View Full Code Here

            public boolean isComplex() {
                return false;
            }
        };
        final Dependency dependency = new FixedTTLDependency(
            SystemClock.getDefaultInstance(), Period.inSeconds(0));
        cache.retrieve(cacheKey, new TestCacheableObjectProvider(
            cache.getRootGroup(), true,
            new CacheBodyOperationProcess.RecordingWithDependency(
                recording, dependency)));
View Full Code Here

TOP

Related Classes of com.volantis.shared.dependency.Dependency

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.