Package org.apache.myfaces.orchestra.conversation

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


        {
            // Note that ConversationManager.getInstance requires the FrameworkAdapter
            // to be initialised...
            //
            // ?? Why is false passed here ??
            ConversationManager manager = ConversationManager.getInstance(false);
            if (manager != null)
            {
                context = manager.getCurrentConversationContext();
                if (context != null)
                {
                    try
                    {
                        context.lockInterruptablyForCurrentThread();
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();
        if (manager.hasConversationContext())
        {
            return Long.toString(manager.getConversationContextId().longValue(), 10);
        }

        return null;
    }
View Full Code Here

    {
        if (log.isDebugEnabled())
        {
            log.debug("getRealBean called for bean " + 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
            {
                // sanity check: verify that two beans with the different scopes
                // do not declare the same conversationName.
View Full Code Here

     * 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

            // currently encoded into each url (see ConversationRequestParameterProvider).
            // So avoiding creating it here is probably not very important..
            //
            // Note that ConversationManager.getInstance requires the FrameworkAdapter
            // to be initialized.
            ConversationManager manager = ConversationManager.getInstance(false);
            if (manager != null)
            {
                // Fetch a context for this request if one already exists, and lock it
                // so that concurrent requests that affect this context block until
                // this request is complete. Not doing so can cause races for resources
                // within the current context, such as beans or PersistenceContexts.
                //
                // But if the request did not explicitly specify a contextId then we
                // do NOT create a new context at this point. Doing so would create
                // contexts for things like Weblet resource requests, and that context
                // would then just hang around unused until it times out!
                //
                // Note that a request that does not explicitly specify a contextId
                // might have one created for it later in the request, eg when an
                // orchestra-scoped bean is accessed. However this is not a race
                // condition because nothing else can refer to that newly created
                // id until the response for this request has been sent back to the
                // client browser.
                context = manager.getCurrentRootConversationContext();
                if (context != null)
                {
                    try
                    {
                        if (log.isDebugEnabled())
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

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

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

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.