Examples of EnvironmentContext


Examples of com.volantis.mcs.context.EnvironmentContext

     * of the incoming request
     */
    private void storeVisitedIdsInPipelineContext(
            final MarinerServletRequestContext requestContext) {

        final EnvironmentContext environmentContext =
            ContextInternals.getEnvironmentContext(requestContext);
        final XMLPipelineContext pipelineContext =
            environmentContext.getPipelineContext();

        // store the ID's of the visited MCS instances adding the ID of the
        // current instance.
        String instances = requestContext.getHttpRequest().getHeader(
            URLConfigurationFactory.VISITED_MCS_INSTANCES_HEADER_NAME);
View Full Code Here

Examples of com.volantis.mcs.context.EnvironmentContext

        pageContext.setPolicyReferenceResolver(referenceResolverMock);

        referenceResolverMock.expects.resolveQuotedTextExpression(null)
                .returns(null).any();

        EnvironmentContext envContext = new TestEnvironmentContext();
        ContextInternals.setEnvironmentContext(requestContext, envContext);

        ContextInternals.setMarinerPageContext(requestContext, pageContext);
        ContextInternals.setApplicationContext(requestContext, appContext);
View Full Code Here

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

Examples of com.volantis.mcs.context.EnvironmentContext

            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

Examples of com.volantis.mcs.context.EnvironmentContext

//            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

Examples of com.volantis.mcs.context.EnvironmentContext

        // 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

Examples of com.volantis.mcs.context.EnvironmentContext

     */
    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

Examples of com.volantis.mcs.context.EnvironmentContext

    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

Examples of com.volantis.mcs.context.EnvironmentContext

     */
    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

Examples of com.volantis.mcs.context.EnvironmentContext

        // 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
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.