Examples of FrameworkAdapter


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

     * <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");
            }
        }

        Object cmObj = frameworkAdapter.getSessionAttribute(CONVERSATION_MANAGER_KEY);
        // hack: see method readResolve
        if (cmObj == DUMMY)
        {
            Log log = LogFactory.getLog(ConversationManager.class);
            log.debug("Method getInstance found dummy ConversationManager object");
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

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