Package com.volantis.mcs.application

Examples of com.volantis.mcs.application.ApplicationContextFactory


    private void registerPrerendererApplication() {
        // Create servlet and internal application context factory.
        // TODO: There's no internal context factory, because
        // it's not needed for now.
        if (!skipApplicationRegistration) {
            ApplicationContextFactory servletContextFactory = new ServletPrerendererApplicationContextFactory();
            ApplicationContextFactory internalContextFactory = null;

            // Create registry container with servlet and internal context
            // factories.
            ApplicationRegistryContainer registryContainer = new ApplicationRegistryContainer();
            registryContainer
View Full Code Here


            MarinerURL requestURL =
                    volantisBean.getClientAccessibleURL(
                            new MarinerURL("internalRequest"));

            ApplicationContext appContext;
            ApplicationContextFactory acf =
                    applicationRegistryContainer
                    .getInternalApplicationContextFactory();


            // Save away a reference to the enclosing MarinerRequestContext
            // if any.
            enclosingRequestContext = getCurrent(request);
            if (enclosingRequestContext != null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Saving reference to "
                            + enclosingRequestContext
                            + " from " + request);
                }
            }

            // Get a MarinerPageContext object.
            final MarinerPageContext context;

            if (enclosingRequestContext != null) {
                context =
                        ContextInternals.getMarinerPageContext(
                                enclosingRequestContext);
            } else {
                context = volantisBean.createMarinerPageContext();
            }

            // Create and initialise the EnvironmentContext, do this after the
            // MarinerPageContext has been allocated but before it has been
            // initialised as this is needed during the initialisation.
            environmentContext.initialise(context);
            environmentContext.initialiseSession();

            ExpressionContext exprContext =
                    environmentContext.getExpressionContext();

            // If there is an expression context then it must have been associated
            // with an enclosing request context since we are still initialising
            // this instance of MarinerServletRequestContext. We now must associate
            // the expression context with this MarinerServletRequestContext.
            //
            // An expression context can be associated with more than one request
            // context, although not concurrently. When the request context is no
            // longer needed, the expression context (if any) should be reset to
            // the enclosing request context.
            if (exprContext == null) {
                ExpressionSupport.createExpressionEnv(this,
                        volantisBean, environmentContext,
                        context.getDevicePolicyAccessor());
            } else {
                exprContext.setProperty(MarinerRequestContext.class, this,
                        false);
            }

            ContextInternals.setEnvironmentContext(this, environmentContext);

            if (enclosingRequestContext != null) {
                // Copy our application context, as nothing has changed from an
                // application point of view.
                appContext =
                        ContextInternals.getApplicationContext(
                                enclosingRequestContext);
                if (logger.isDebugEnabled()) {
                    logger.debug("Retrieved applicationContext " + appContext);
                }
            } else {
                // We are the top level request so initialise an application context
                // for this application
                appContext = acf.createApplicationContext(this);
                if (logger.isDebugEnabled()) {
                    logger.debug(
                            "Created new applicationContext " + appContext);
                }
            }
View Full Code Here

            MarinerURL requestURL = createRequestURL(request);
            requestURL = volantisBean.getClientAccessibleURL(requestURL);

            ApplicationContext appContext;
            ApplicationContextFactory acf =
                    applicationRegistryContainer.getServletApplicationContextFactory();


            // Save away a reference to the enclosing MarinerRequestContext
            // if any.
            enclosingRequestContext = getCurrent(request);
            if (enclosingRequestContext != null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Saving reference to "
                            + enclosingRequestContext
                            + " from " + request);
                }
            }

            // Get a MarinerPageContext object.
            final MarinerPageContext context;

            if (enclosingRequestContext != null) {
                context =
                        ContextInternals.getMarinerPageContext(
                                enclosingRequestContext);
            } else {
                context = volantisBean.createMarinerPageContext();
            }

            // Create and initialise the EnvironmentContext, do this after the
            // MarinerPageContext has been allocated but before it has been
            // initialised as this is needed during the initialisation.
            environmentContext.initialise(context);
            environmentContext.initialiseSession();

            ExpressionContext exprContext =
                    environmentContext.getExpressionContext();

            // If there is an expression context then it must have been associated
            // with an enclosing request context since we are still initialising
            // this instance of MarinerServletRequestContext. We now must associate
            // the expression context with this MarinerServletRequestContext.
            //
            // An expression context can be associated with more than one request
            // context, although not concurrently. When the request context is no
            // longer needed, the expression context (if any) should be reset to
            // the enclosing request context.
            if (exprContext == null) {
                ExpressionSupport.createExpressionEnv(this,
                        volantisBean, environmentContext,
                        context.getDevicePolicyAccessor());
            } else {
                exprContext.setProperty(MarinerRequestContext.class, this,
                        false);
            }

            ContextInternals.setEnvironmentContext(this, environmentContext);

            if (enclosingRequestContext != null) {
                // Copy our application context, as nothing has changed from an
                // application point of view.
                appContext =
                        ContextInternals.getApplicationContext(
                                enclosingRequestContext);
                if (logger.isDebugEnabled()) {
                    logger.debug("Retrieved applicationContext " + appContext);
                }
            } else {
                // We are the top level request so initialise an application context
                // for this application
                appContext = acf.createApplicationContext(this);
                if (logger.isDebugEnabled()) {
                    logger.debug(
                            "Created new applicationContext " + appContext);
                }
            }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.application.ApplicationContextFactory

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.