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

     * <p>
     * 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)
        {
            conversationManager = FactoryFinder.getConversationManagerFactory().createConversationManager();

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

    {
    }

    public static RequestParameterProviderManager getInstance()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa == null)
        {
            Log log = LogFactory.getLog(RequestParameterProviderManager.class);
            log.error("No framework adapter currently selected");
            throw new OrchestraException("No framework adapter currently selected");
        }
        RequestParameterProviderManager manager =
            (RequestParameterProviderManager) fa.getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);

        if (manager == null)
        {
            // TODO: remove this factory code. Not IOC-friendly.
            manager = new RequestParameterProviderManager();
            fa.setSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY, manager);
        }

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

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

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