Package org.apache.myfaces.orchestra.conversation

Examples of org.apache.myfaces.orchestra.conversation.ConversationManager


   * Note: This conversationId is something spring requires. It has nothing to do with the Orchestra
   * conversation id.
   */
  public String getConversationId()
  {
    ConversationManager manager = ConversationManager.getInstance();
    if (manager.hasConversationContext())
    {
      return Long.toString(manager.getConversationContextId().longValue(), 10);
    }

    return null;
  }
View Full Code Here


  /** See method get(name, objectFactory). */
  protected Object getBean(String beanName, ObjectFactory objectFactory)
  {
    String conversationName = getConversationNameForBean(beanName);

    ConversationManager manager = ConversationManager.getInstance();
    Conversation conversation;

    // check if we have a conversation
    synchronized(manager)
    {
      conversation = manager.getConversation(conversationName);
      if (conversation == null)
      {
        // Start the conversation. This eventually results in a
        // callback to the createConversation method on this class.
        conversation = manager.startConversation(conversationName, this);
      }
      else
      {
                assertSameScope(beanName, conversation);
            }
View Full Code Here

  /**
   * Get the conversation for the given beanName.
   */
  protected Conversation getConversationForBean(String beanName)
  {
    ConversationManager manager = ConversationManager.getInstance();
    Conversation conversation = manager.getConversation(getConversationNameForBean(beanName));
    return conversation;
  }
View Full Code Here

        // part of the page remains unsubmitted.
        return;
      }
    }

    ConversationManager conversationManager = ConversationManager.getInstance(false);
    if (conversationManager == null)
    {
      return;
    }

    Iterator iterConversations = conversationManager.iterateConversations();
    while (iterConversations.hasNext())
    {
      Conversation conversation = (Conversation) iterConversations.next();
     
      // This conversation has "flash" scope if it has an attached Aspect
View Full Code Here

  /**
   * end and restart a conversation
   */
  public static void endAndRestartConversation(FacesContext context, String conversationName, Boolean restart, MethodBinding restartAction)
  {
    ConversationManager conversationManager = ConversationManager.getInstance();
    Conversation conversation = conversationManager.getConversation(conversationName);
    if (conversation != null)
    {
      conversation.invalidate();
    }

View Full Code Here

                // part of the page remains unsubmitted.
                return;
            }
        }

        ConversationManager conversationManager = ConversationManager.getInstance(false);
        if (conversationManager == null)
        {
            return;
        }

        boolean isDebug = log.isDebugEnabled();
        Iterator iterConversations = conversationManager.iterateConversations();
        while (iterConversations.hasNext())
        {
            Conversation conversation = (Conversation) iterConversations.next();
           
            // This conversation has "access" scope if it has an attached Aspect
View Full Code Here

                }
            }
        }

        // check that all the required conversations already exist
        ConversationManager manager = ConversationManager.getInstance();
        String[] conversationNames = conversationRequire.conversationNames();
        if (conversationNames != null)
        {
            for(String conversationName: conversationNames)
            {
                if (!manager.hasConversation(conversationName))
                {
                    reportInactive(manager, conversationName, conversationRequire);
                    return;
                }
            }
View Full Code Here

    public void attributeAdded(HttpSessionBindingEvent event)
    {
        // Somebody has called session.setAttribute
        if (event.getValue() instanceof ConversationManager)
        {
            ConversationManager cm = (ConversationManager) event.getValue();
            conversationWiperThread.addConversationManager(cm);
        }
    }
View Full Code Here

        {
            if (log.isDebugEnabled())
            {
                log.debug("A ConversationManager instance has been removed from a session");
            }
            ConversationManager cm = (ConversationManager) event.getValue();
            removeAndInvalidateConversationManager(cm);
        }
    }
View Full Code Here

    {
        // Note that this method is called *after* the attribute has been replaced,
        // and that event.getValue contains the old object.
        if (event.getValue() instanceof ConversationManager)
        {
            ConversationManager oldConversationManager = (ConversationManager) event.getValue();
            removeAndInvalidateConversationManager(oldConversationManager);
        }

        // The new object is already in the session and can be retrieved from there
        HttpSession session = event.getSession();
        String attrName = event.getName();
        Object newObj = session.getAttribute(attrName);
        if (newObj instanceof ConversationManager)
        {
            ConversationManager newConversationManager = (ConversationManager) newObj;
            conversationWiperThread.addConversationManager(newConversationManager);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.orchestra.conversation.ConversationManager

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.