Examples of ConversationManager


Examples of org.apache.tuscany.sca.core.conversation.ConversationManager

        if (!conversational) {
            // Not conversational or the conversation has been started
            return;
        }

        ConversationManager conversationManager = ((RuntimeWireImpl)wire).getConversationManager();

        if (conversation == null || conversation.getState() == ConversationState.ENDED) {

            conversation = conversationManager.startConversation(getConversationID());

            // if this is a local wire then set up the conversation timeouts here based on the
            // parameters from the component
            if (wire.getTarget().getComponent() != null) {
                conversation.initializeConversationAttributes(wire.getTarget().getComponent());
View Full Code Here

Examples of org.apache.tuscany.sca.core.conversation.ConversationManager

            registry.getExtensionPoint(ModelFactoryExtensionPoint.class).getFactory(JavaInterfaceFactory.class);
        RequestContextFactory requestContextFactory =
            registry.getExtensionPoint(ContextFactoryExtensionPoint.class).getFactory(RequestContextFactory.class);

        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        ConversationManager conversationManager = utilities.getUtility(ConversationManager.class);

        // Create the composite activator
        CompositeActivator compositeActivator =
            new CompositeActivatorImpl(assemblyFactory, messageFactory, javaInterfaceFactory, scaBindingFactory,
                                       mapper, scopeRegistry, workScheduler, wireProcessor, requestContextFactory,
View Full Code Here

Examples of org.apache.tuscany.sca.core.conversation.ConversationManager

            registry.getExtensionPoint(ModelFactoryExtensionPoint.class).getFactory(JavaInterfaceFactory.class);
        RequestContextFactory requestContextFactory =
            registry.getExtensionPoint(ContextFactoryExtensionPoint.class).getFactory(RequestContextFactory.class);

        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        ConversationManager conversationManager = utilities.getUtility(ConversationManager.class);
       
        // Create the composite activator
        CompositeActivator compositeActivator =
            new CompositeActivatorImpl(assemblyFactory, messageFactory, javaInterfaceFactory, scaBindingFactory,
                                       mapper, scopeRegistry, workScheduler, wireProcessor, requestContextFactory,
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

            logger.debug("Destroying a session with session id : [{0}]", event.getSession().getId());
        }

        this.webBeansContext.getContextsService().endContext(SessionScoped.class, event.getSession());

        ConversationManager conversationManager = webBeansContext.getConversationManager();
        conversationManager.destroyConversationContextWithSessionId(event.getSession().getId());
    }
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

                ((WebContextsService) webBeansContext.getContextsService()).getSessionContextManager();
        SessionContext sessionContext = sessionManager.getSessionContextWithSessionId(session.getId());
        bag.put(ATTRIBUTE_SESSION_CONTEXT, sessionContext);

        // store all conversation contexts
        ConversationManager conversationManager = webBeansContext.getConversationManager();
        bag.put(ATTRIBUTE_CONVERSATION_CONTEXT_MAP, conversationManager.getConversationMapWithSessionId(session.getId()));

        if (LOGGER.isLoggable(Level.FINE))
        {
            LOGGER.log(Level.FINE, "Beans for session [" + bag.getSessionId() + "] successfully stored in FailOverBag.");
        }
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

            Map<Conversation, ConversationContext> conversationContextMap =
                    (Map<Conversation, ConversationContext>) bag.get(ATTRIBUTE_CONVERSATION_CONTEXT_MAP);

            if (conversationContextMap != null && !conversationContextMap.isEmpty())
            {
                ConversationManager conversationManager = webBeansContext.getConversationManager();
                Iterator<Conversation> iterator = conversationContextMap.keySet().iterator();

                while (iterator.hasNext())
                {
                    Conversation conversation = iterator.next();
                    ConversationContext context = conversationContextMap.get(conversation);
                    conversationManager.addConversationContext(conversation, context);
                }
            }

            if (LOGGER.isLoggable(Level.FINE))
            {
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

        conversationContext.setActive(true);

        Conversation conversation = new ConversationImpl(session.getId(), getWebBeansContext());
        conversation.begin();

        ConversationManager conversationManager = getWebBeansContext().getConversationManager();
        conversationManager.addConversationContext(conversation, conversationContext);

        getWebBeansContext().registerService(ConversationService.class, new MockConversationService(session, conversation));

        // set sample text
        getInstance(ConversationScopedBean.class, conversationContext).setText(CONVERSATION_SCOPED_SAMPLE_TEXT);

        // store beans in session
        failoverService.sessionIsIdle(session);

        // serialize / deserialize and store deserialized bag back to session
        FailOverBag failOverBag;
        failOverBag = (FailOverBag) session.getAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME);
        failOverBag = (FailOverBag) serialize(failOverBag);

        session.setAttribute(FailOverBag.SESSION_ATTRIBUTE_NAME, failOverBag);

        // remove sample text
        getInstance(ConversationScopedBean.class, conversationContext).setText(null);

        getWebBeansContext().getContextsService().endContext(ConversationScoped.class, conversationContext);

        // restore beans from session
        failoverService.sessionDidActivate(session);



        // ----- assert
        // get and activate conversation
        Map<Conversation, ConversationContext> conversationMap =
                conversationManager.getConversationMapWithSessionId(session.getId());

        Conversation propogatedConversation =
                conversationManager.getPropogatedConversation(conversation.getId(), session.getId());

        ConversationContext propogatedConversationContext =  conversationMap.get(propogatedConversation);
        propogatedConversationContext.setActive(true);

        ConversationScopedBean beanInstance = getInstance(ConversationScopedBean.class, propogatedConversationContext);
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

        {
            logger.debug("Destroying a session with session id : [{0}]", event.getSession().getId());
        }
        this.webBeansContext.getContextsService().endContext(SessionScoped.class, event.getSession());

        ConversationManager conversationManager = webBeansContext.getConversationManager();
        conversationManager.destroyConversationContextWithSessionId(event.getSession().getId());
    }
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

    {
        // get the session context
        sessionContext = (SessionContext) webBeansContext.getBeanManagerImpl().getContext(SessionScoped.class);

        // get all conversation contexts
        ConversationManager conversationManager = webBeansContext.getConversationManager();
        conversationContextMap = conversationManager.getConversationMapWithSessionId(session.getId());
    }
View Full Code Here

Examples of org.apache.webbeans.conversation.ConversationManager

                sessionManager.addNewSessionContext(sessionId, sessionContext);
                sessionContext.setActive(true);
            }
            if (conversationContextMap != null && !conversationContextMap.isEmpty())
            {
                ConversationManager conversationManager = webBeansContext.getConversationManager();
                java.util.Iterator<Conversation> it = conversationContextMap.keySet().iterator();
                while(it.hasNext())
                {
                    Conversation c = it.next();
                    ConversationContext cc = conversationContextMap.get(c);
                    conversationManager.addConversationContext(c, cc);
                }
            }
        }
        catch (Exception e)
        {
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.