Package com.volantis.xml.pipeline.sax.cache.body

Examples of com.volantis.xml.pipeline.sax.cache.body.CacheBodyOperationProcess


        cacheProcessConfig.setFixedExpiryMode(false);

        cacheRule.startElement(dynamicProcessMock, elementName, attributes);

        final CacheBodyOperationProcess process = cacheBodyOperationProcess[0];
        final CacheControl cacheControl = process.getCacheControl();
        assertEquals(Period.inSeconds(123), cacheControl.getTimeToLive());
        assertFalse(process.isFixedExpiryMode());
    }
View Full Code Here


            final Cache cache = cpc.getCache(cacheName);

            // if properties is null then cacheBody element is used outside
            // cache element or cache element has key attribute set, so
            // recording process has been already started.
            CacheBodyOperationProcess operation =
                    new CacheBodyOperationProcess();

            XMLPipeline pipeline = dynamicProcess.getPipeline();

            operation.setCacheName(cacheName);
            operation.setCacheKey(properties.getCacheKey());
            final CacheControl cacheControl = properties.getCacheControl();
            if (cacheControl != null && cacheControl.getTimeToLive() == null) {
                // if no TTL period has been set, use the default value for this
                // cache
                cacheControl.setTimeToLive(cpc.getDefaultTimeToLive(cacheName));
            }
            operation.setCacheControl(cacheControl);
            operation.setPipeline(pipeline);
            operation.setCache(cache);
            operation.setFixedExpiryMode(properties.isFixedExpiryMode());
            operation.setMaxWaitTime(properties.getMaxWaitTime());

            try {
                CacheBodyOperationProcessState state =
                        operation.initializeProcessState();

                // If there is a cached recorder to playback from then we want
                // to suppress all of the content.
                if (state == CacheBodyOperationProcessState.
                        PLAYBACK_AND_SUPPRESS) {
View Full Code Here

                // <cacheBody>? is optional


                // Need to populate the cache by doing the OperationProcess
                // at least once.
                CacheBodyOperationProcess operation =
                        new CacheBodyOperationProcess();

                final CacheControl cacheControl = new CacheControl();
                cacheControl.setTimeToLive(cpc.getDefaultTimeToLive(cacheName));
                operation.setCacheControl(cacheControl);

                operation.setCacheName(cacheName);
                operation.setCache(cache);
                CacheKey cacheKey = new CacheKey();
                cacheKey.addKey(cacheKeyString);
                operation.setCacheKey(cacheKey);
                XMLPipeline pipeline = dynamicProcess.getPipeline();
                operation.setPipeline(pipeline);
                operation.setFixedExpiryMode(fixedExpiryMode);
                operation.setMaxWaitTime(maxWaitTime);

                try {
                    CacheBodyOperationProcessState state =
                            operation.initializeProcessState();

                    // If there is a cached recorder to playback from
                    // then we want to suppress all of the content.
                    if (state == CacheBodyOperationProcessState.
                            PLAYBACK_AND_SUPPRESS) {
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.cache.body.CacheBodyOperationProcess

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.