Package org.apache.myfaces.orchestra.conversation

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


     * Get the conversation for the given beanName.
     * Returns null if the conversation does not exist.
     */
    protected Conversation getConversationForBean(String beanDefName)
    {
        ConversationManager manager = ConversationManager.getInstance();
        String conversationName = getConversationNameForBean(beanDefName);
        Conversation conversation = manager.getConversation(conversationName);
        return conversation;
    }
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

        // called once for every attribute in the session; note however that at that time the
        // session is invalid so in some containers certain methods (including getId and
        // getAttribute) throw IllegalStateException.
        if (event.getValue() instanceof ConversationManager)
        {
            ConversationManager cm = (ConversationManager) event.getValue();
            conversationWiperThread.removeConversationManager(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();
            conversationWiperThread.removeConversationManager(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

                // Hmm..actually, we should make sure the wiper thread never cleans up anything
                // associated with a session that is currently in use by a request. That should
                // then be sufficient, as the timeouts will only apply after the end of the
                // request that caused this activation to occur by which time any relevant
                // timestamps have been restored.
                ConversationManager cm = (ConversationManager) val;
                conversationWiperThread.addConversationManager(cm);
            }
        }
    }
View Full Code Here

        {
            String attrName = (String) e.nextElement();
            Object val = session.getAttribute(attrName);
            if (val instanceof ConversationManager)
            {
                ConversationManager cm = (ConversationManager) val;
                conversationWiperThread.removeConversationManager(cm);
            }
        }
    }
View Full Code Here

                returnValue = original.invoke(context, values);
            }
        }
        catch (Throwable t)
        {
            ConversationManager conversationManager = ConversationManager.getInstance();

            if (errorOutcome != null)
            {
                // Suppress the exception, and act as if errorOutcome had been returned.

                conversationManager.getMessager().setConversationException(t);
                returnValue = errorOutcome;
            }
            else
            {
                // When no errorOutcomes are specified, then there is nothing to check against
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

     * 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

     * <p>
     * TODO: what does Spring use this for????
     */
    public String getConversationId()
    {
        ConversationManager manager = ConversationManager.getInstance();
        ConversationContext ctx = manager.getCurrentConversationContext();
        if (ctx != null)
        {
            return Long.toString(ctx.getId(), 10);
        }

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.