Package com.volantis.shared.dependency

Examples of com.volantis.shared.dependency.Dependency.revalidate()


        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


                     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

        generateSimpleElement(target, freshness.toString(),
                "freshness");

        // Generate an element containing the revalidated freshness.
        if (freshness == Freshness.REVALIDATE) {
            Freshness revalidated = dependency.revalidate(context);
            generateSimpleElement(target, revalidated.toString(),
                    "revalidated");
        }

        Cacheability cacheability = dependency.getCacheability();
View Full Code Here

        Dependency dependency = tracker.extractDependency();
        assertEquals(Cacheability.CACHEABLE, dependency.getCacheability());
        assertEquals(Period.INDEFINITELY, dependency.getTimeToLive());
        TestCaseAbstract.assertEquals(Freshness.FRESH, dependency.freshness(contextMock));
        try {
            dependency.revalidate(contextMock);
            fail("Did not detect invalid call to revalidate");
        } catch(IllegalStateException e) {
            // Expected.
        }
View Full Code Here

        assertEquals(Period.inSeconds(100), timeToLive);

        Freshness freshness = aggregate.freshness(contextMock);
        assertEquals(Freshness.REVALIDATE, freshness);

        Freshness revalidate = aggregate.revalidate(contextMock);
        assertEquals(Freshness.FRESH, revalidate);
    }
}
View Full Code Here

                        final Dependency dependency = value.getDependency();
                        Freshness freshness =
                            dependency.freshness(dependencyContext);
                        if (freshness == Freshness.REVALIDATE) {
                            freshness =
                                dependency.revalidate(dependencyContext);
                        }

                        // if the dependency is fresh, cache can play the
                        // content back
                        if (freshness == Freshness.FRESH) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.