Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.ResponseCachingDirectives.enable()


            try {
                Period maxage = Period.inSeconds(Long.parseLong(content));

                cachingDirectives.setMaxAge(maxage,
                        ResponseCachingDirectives.PRIORITY_HIGH);
                cachingDirectives.enable();
            } catch (NumberFormatException e) {
                // If string didn't parse to long property, throw an exception
                // reusing existing localised message, saying that Period was
                // expected, but String was encountered.
                throw new PAPIException(EXCEPTION_LOCALIZER.format(
View Full Code Here


    private void applyCacheAuto(MarinerRequestContext context) {
        final ResponseCachingDirectives cachingDirectives =
                getCachingDirectives(context);

        if (cachingDirectives != null) {
            cachingDirectives.enable();
        }
    }

    /**
     * Looks up the <code>ResponseCachingDirectives</code> for this request
View Full Code Here

        context.expects.getInitialRequestContext().returns(requestContext);
        final EnvironmentContextMock environmentContextMock =
            new EnvironmentContextMock("environmentContextMock", expectations);
        final ResponseCachingDirectives cachingDirectives =
            new ResponseCachingDirectives(SystemClock.getDefaultInstance());
        cachingDirectives.enable();
        assertTrue(cachingDirectives.isEnabled());

        environmentContextMock.expects.getCachingDirectives().returns(
            cachingDirectives);
        requestContext.expects.getEnvironmentContext().returns(
View Full Code Here

        context.expects.getInitialRequestContext().returns(requestContext);
        final EnvironmentContextMock environmentContextMock =
            new EnvironmentContextMock("environmentContextMock", expectations);
        final ResponseCachingDirectives cachingDirectives =
            new ResponseCachingDirectives(SystemClock.getDefaultInstance());
        cachingDirectives.enable();
        assertTrue(cachingDirectives.isEnabled());

        environmentContextMock.expects.getCachingDirectives().returns(
            cachingDirectives);
        requestContext.expects.getEnvironmentContext().returns(
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.