Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.EnvironmentContext


        MarinerServletRequestContext marinerRequestContext = null;
        try {
            marinerRequestContext = xdimeRequestProcessorHelper.
                createServletRequestContext(servletContext, request, response);

            final EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(marinerRequestContext);

            // we need to store the service definintion away in the
            // expression context
            configureServiceDefintion(marinerRequestContext,
                                      environmentContext);
            final ResponseCachingDirectives cachingDirectives =
                environmentContext.getCachingDirectives();
            if (cachingDirectives != null && disableResponseCaching) {
                cachingDirectives.disable();
            }
            processXDIME(marinerRequestContext, xdimeContent, characterSet);
        } catch (MarinerContextException e) {
View Full Code Here


            final Encoding encoding = pageContext.getCharsetEncoding();
            if (encoding == null) {
                throw new PackagingException(
                            exceptionLocalizer.format("no-charset"));
            }
            final EnvironmentContext envContext =
                    pageContext.getEnvironmentContext();

            // Get the body source written to the response writer
            bodySource.write(new AbstractPackageBodyOutput() {
                // Retrieve the output stream from the page context and
                // filter up any errors
                public OutputStream getRealOutputStream() {
                    try {
                        return envContext.getResponseOutputStream();
                    } catch (MarinerContextException mce) {
                        throw new RuntimeException(mce);
                    }
                }

                // Retrieve the output writer from the page context, convert it
                // to a CharsetEncodingWriter and filter up any errors
                public Writer getRealWriter() {
                    try {
                        return new CharsetEncodingWriter(
                                envContext.getResponseWriter(), encoding);
                    } catch (MarinerContextException mce) {
                        throw new RuntimeException(mce);
                    }
                }
            }, context, bodyContext);
View Full Code Here

//            MCSExpressionHelper.setExpressionContext(
//                    requestContext, pipelineContext.getExpressionContext());
        }

                // get hold of the environment context associated with the request
        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        environmentContext.initalisePipelineContextEnvironment(pipelineContext);

      XMLPipeline pipeline = factory.createDynamicPipeline(pipelineContext);
      // create the pipeline fiter
      XMLPipelineFilter pipelineFilter = null;
        try {
View Full Code Here

        // Perform default property processing.
        super.process(content, context, id, propertyName);

        // Set expires property on environment context. This would produce
        // appropriate cache-control/expires headers in HTTP response.
        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(
                context.getInitialRequestContext());
        final ResponseCachingDirectives cachingDirectives =
            environmentContext.getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.setExpires((Time) content,
                ResponseCachingDirectives.PRIORITY_HIGH);
            cachingDirectives.enable();
        }
View Full Code Here

     */
    private static EnvironmentInteraction createRootInteraction(
            MarinerRequestContext requestContext) {

        // get hold of the environment context associated with the request
        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);
        return environmentContext.createRootEnvironmentInteraction();
    }
View Full Code Here

    private static void setPipelineContext(
            XMLPipelineContext pipelineContext,
            MarinerRequestContext requestContext) {

        // get hold of the environment context associated with the request
        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        // save the pipeline context away in the environment context
        environmentContext.setPipelineContext(pipelineContext);
    }
View Full Code Here

     */
    private static XMLPipelineContext getPipelineContext(
            MarinerRequestContext requestContext) {

        // get hold of the environment context associated with the request
        EnvironmentContext environmentContext =
                ContextInternals.getEnvironmentContext(requestContext);

        return environmentContext.getPipelineContext();
    }
View Full Code Here

        // Perform default property processing.
        super.process(content, context, id, propertyName);

        // Set maxAge property on environment context. This would produce
        // appropriate cache-control directives in HTTP response.
        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(
                context.getInitialRequestContext());
        final ResponseCachingDirectives cachingDirectives =
            environmentContext.getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.setMaxAge((Period) content,
                ResponseCachingDirectives.PRIORITY_HIGH);
            cachingDirectives.enable();
        }
View Full Code Here

        // Perform default property processing.
        super.process(content, context, id, propertyName);

        // Enable caching
        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(
                context.getInitialRequestContext());
        final ResponseCachingDirectives cachingDirectives =
            environmentContext.getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.enable();
        }
    }
View Full Code Here

        // Perform default property processing.
        super.process(content, context, id, propertyName);

        // Set maxAge property on environment context. This would produce
        // appropriate cache-control directives in HTTP response.
        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(
                context.getInitialRequestContext());
        final ResponseCachingDirectives cachingDirectives =
            environmentContext.getCachingDirectives();
        if (cachingDirectives != null) {
            cachingDirectives.setMaxAge((Period) content,
                ResponseCachingDirectives.PRIORITY_HIGH);
            cachingDirectives.enable();
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.EnvironmentContext

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.