Examples of FrameworkAdapter


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

                    .getExternalContext());

            if (RequestType.RENDER.equals(type))
            {
                String handlersKey = (String) fnextToken;
                FrameworkAdapter adapter = (FrameworkAdapter) getExternalContext()
                        .getApplicationMap().remove(
                                REQUEST_ADAPTER + handlersKey);
                if (FrameworkAdapter.getCurrentInstance() == null)
                {
                    FrameworkAdapter.setCurrentInstance(adapter);
View Full Code Here

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

            }
            else
            {
                //Pass the current FrameworkAdapter through application map,
                //to remove it later when rendering
                FrameworkAdapter adapter = FrameworkAdapter.getCurrentInstance();
                getExternalContext().getApplicationMap().put(
                        REQUEST_ADAPTER + _nextToken, adapter);
               
                //Orchestra suppose the same thread handles the current request, but
                //in portlets this is not necessary true. One thread could handle action
View Full Code Here

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

                    .getExternalContext());

            if (RequestType.RENDER.equals(type))
            {
                String handlersKey = (String) fnextToken;
                FrameworkAdapter adapter = (FrameworkAdapter) getExternalContext()
                        .getApplicationMap().remove(
                                REQUEST_ADAPTER + handlersKey);
                if (FrameworkAdapter.getCurrentInstance() == null)
                {
                    FrameworkAdapter.setCurrentInstance(adapter);
View Full Code Here

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

            }
            else
            {
                //Pass the current FrameworkAdapter through application map,
                //to remove it later when rendering
                FrameworkAdapter adapter = FrameworkAdapter.getCurrentInstance();
                getExternalContext().getApplicationMap().put(
                        REQUEST_ADAPTER + _nextToken, adapter);
               
                //Orchestra suppose the same thread handles the current request, but
                //in portlets this is not necessary true. One thread could handle action
View Full Code Here

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

        return sb.toString();
    }

    protected boolean isResponseIntercepted()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();

        return Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED))
            || Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_RESPONSE_WRAPPED));
    }
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 should not created one, 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.
            conversationManager = new ConversationManager();
View Full Code Here

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

     * <p>
     * This method <i>never</i> returns null.
     */
    public Long getConversationContextId()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();

        // first, check whether we have previously found this value and cached it as a
        // request-scoped value.
        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));
            }
            else
            {
                synchronized(this)
                {
                    conversationContextId = new Long(nextConversationContextId);
                    nextConversationContextId++;
                }
            }

            fa.setRequestAttribute(CONVERSATION_CONTEXT_REQ, conversationContextId);
        }

        return conversationContextId;
    }
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

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

        return sb.toString();
    }

    protected boolean isResponseIntercepted()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();

        return Boolean.TRUE.equals(
                fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED))
            || Boolean.TRUE.equals(
                fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_RESPONSE_WRAPPED));
    }
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.