Examples of FrameworkAdapter


Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

                init, nextToken, handlers, contextLockHandler);
    }
   
    private void setRequestParameterResponseWrappedMode(Object context, Object request)
    {
        FrameworkAdapter nonJsfFrameworkAdapter = FrameworkAdapter.getCurrentInstance();
        if (nonJsfFrameworkAdapter != null)
        {
            if (!Boolean.TRUE.equals(nonJsfFrameworkAdapter.getRequestAttribute(
                    RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED)))
            {
                nonJsfFrameworkAdapter.setRequestAttribute(
                        RequestParameterServletFilter.REQUEST_PARAM_RESPONSE_WRAPPED, Boolean.TRUE);
            }
        }
        else if (!getBooleanRequestValue(request,
                RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED))
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // Note: When a session has timed out normally, then  currentFrameworkAdapter will
        // be null. But when a request calls session.invalidate directly, then this function
        // is called within the thread of the request, and so will have a FrameworkAdapter
        // in the current thread (which has been initialized with the http request object).

        FrameworkAdapter currentFrameworkAdapter = FrameworkAdapter.getCurrentInstance();
        try
        {
            // Always use a fresh FrameworkAdapter to avoid OrchestraException
            // "Cannot remove current context" when a request calls session.invalidate();
            // we want getRequestParameter and related functions to always return null..
            FrameworkAdapter fa = new LocalFrameworkAdapter();
            ConversationMessager conversationMessager = new LogConversationMessager();
            fa.setConversationMessager(conversationMessager);
            FrameworkAdapter.setCurrentInstance(fa);
   
            conversationWiperThread.removeConversationManager(cm);
            cm.removeAndInvalidateAllConversationContexts();
        }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // thing if they were real object references - which is why we do not do this caching when !autoProxy
        // is set, or when the beandef is marked with the standard spring aop:scoped-proxy [see method
        // get(String,ObjectFactory)]. However as these proxies always look up their target again, it is safe
        // to leave them the request; a new bean will still be created if they are dereferenced after the target
        // conversation is invalidated.
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa != null)
        {
            // ORCHESTRA-15 -= Leonardo Uribe =-
            // If it is inside a portlet using JSR-301 bridge do not add it
            // because there are portlet containers like liferay that
            // could scan request attribute map to put in xml form. In that
            // case, FrameworkAdapter will not be found and an exception is
            // thrown when resolving its proxy.
            // It is possible we could have this case too with other portlet
            // bridge implementation (myfaces 1.1 and so) but since from this
            // point we should not call for jsf specific code, we only can
            // check if the current request contains the key "javax.portlet.faces.phase"
            if (fa.containsRequestAttribute(PortletOrchestraFacesContextFactory.PORTLET_LIFECYCLE_PHASE))
            {
                fa.setRequestAttribute(beanName, proxy);
            }
        }


        return proxy;
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // for this spring context, and there is normally only one spring context for a webapp. However
        // using the request scope is almost as efficient and seems safer.
        //
        // Note that the framework adapter might not be initialised during the Spring context initialisation
        // phase (ie instantiation of singletons during startup), so just skip registration in those cases.
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa != null)
        {
            fa.setRequestAttribute(beanName, proxy);
        }


        return proxy;
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * When create is false, null is returned if no instance yet
     * exists for the current user session.
     */
    public static ConversationManager getInstance(boolean create)
    {
        FrameworkAdapter frameworkAdapter = FrameworkAdapter.getCurrentInstance();
        if (frameworkAdapter == null)
        {
            if (!create)
            {
                // if we don't have to create a conversation manager, then it doesn't
                // matter if there is no FrameworkAdapter available.
                return null;
            }
            else
            {
                throw new IllegalStateException("FrameworkAdapter not found");
            }
        }

        ConversationManager conversationManager = (ConversationManager) frameworkAdapter.getSessionAttribute(
                CONVERSATION_MANAGER_KEY);
        if (conversationManager == null && create)
        {
            // TODO: do not call new directly here, as it makes it impossible to configure
            // an alternative ConversationManager instance. This is IOC and test unfriendly.
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * <p>
     * If there is no current conversationContext, then null is returned.
     */
    private Long findConversationContextId()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
       
        // Has it been extracted from the req params and cached as a req attr?
        Long conversationContextId = (Long)fa.getRequestAttribute(CONVERSATION_CONTEXT_REQ);
        if (conversationContextId == null)
        {
            if (fa.containsRequestParameterAttribute(CONVERSATION_CONTEXT_PARAM))
            {
                String urlConversationContextId = fa.getRequestParameterAttribute(
                        CONVERSATION_CONTEXT_PARAM).toString();
                conversationContextId = new Long(
                        Long.parseLong(urlConversationContextId, Character.MAX_RADIX));
            }
        }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

    {
        Long conversationContextId = findConversationContextId();
        if (conversationContextId == null)
        {
            conversationContextId = createNextConversationContextId();
            FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
            fa.setRequestAttribute(CONVERSATION_CONTEXT_REQ, conversationContextId);
        }

        return conversationContextId;
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     *
     * @since 1.2
     */
    public void activateConversationContext(ConversationContext ctx)
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        fa.setRequestAttribute(CONVERSATION_CONTEXT_REQ, ctx.getIdAsLong());
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // from there.
        //
        // Using a lookup of a managed bean allows the user to set configuration properties on the
        // manager class and its properties.

        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        AccessScopeManager manager = (AccessScopeManager) fa.getRequestAttribute(REQ_ATTR_KEY);
        if (manager != null)
        {
            // already found and cached in request attributes
            return manager;
        }

        // Backwards compatibility hack: look for FlashScopeManager. It is possible that
        // a user of Orchestra 1.0 has copied the declaration from the original Orchestra
        // config file into their own code to inject special settings.
        manager = (AccessScopeManager) fa.getBean(FlashScopeManager.class.getName());
        if (manager != null)
        {
            fa.setRequestAttribute(REQ_ATTR_KEY, manager);
            return manager;
        }
       
        // Backwards compatibility hack: look for FlashScopeManagerConfiguration. It is
        // possible that a user of Orchestra 1.0 has overridden just the Configuration
        // bit to set their own ignoredViewId values (as recommended!):
        //
        // This is a little dodgy as settings made through the new AccessScopeManage
        // bean will will now be silently ignored.
        FlashScopeManagerConfiguration cfg = (FlashScopeManagerConfiguration) fa.getBean(
                FlashScopeManagerConfiguration.class.getName());
        if (cfg != null)
        {
            manager = new AccessScopeManager();
            manager.setAccessScopeManagerConfiguration(cfg);
            fa.setRequestAttribute(REQ_ATTR_KEY, manager);
            return manager;
        }
       
        // normal case
        manager = (AccessScopeManager) fa.getBean(AccessScopeManager.class.getName());
        if (manager != null)
        {
            fa.setRequestAttribute(REQ_ATTR_KEY, manager);
            return manager;
        }

        // TODO: Make this error message less spring-specific. Spring is not the only IOC container
        // that Orchestra can be used with.
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // for this spring context, and there is normally only one spring context for a webapp. However
        // using the request scope is almost as efficient and seems safer.
        //
        // Note that the framework adapter might not be initialised during the Spring context initialisation
        // phase (ie instantiation of singletons during startup), so just skip registration in those cases.
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa != null)
        {
            fa.setRequestAttribute(beanName, proxy);
        }


        return proxy;
    }
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.