Examples of Conversation


Examples of javax.enterprise.context.Conversation

            //It looks for cid parameter in the JSF request.
            //If request contains cid, then it must restore conversation
            //Otherwise create NonexistentException
            WebBeansContext webBeansContext = WebBeansContext.getInstance();
            ConversationManager conversationManager = webBeansContext.getConversationManager();
            Conversation conversation = conversationManager.getConversationBeanReference();
            String cid = JSFUtil.getConversationId();
            ContextFactory contextFactory = webBeansContext.getContextFactory();

            if (conversation.isTransient())
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Creating a new transitional conversation with cid : [{0}]", conversation.getId());
                }
                contextFactory.initConversationContext(null);

                //Not restore, throw exception
                if(cid != null && !cid.equals(""))
                {
                    throw new NonexistentConversationException("Propogated conversation with cid=" + cid + " is not restored. It creates a new transient conversation.");
                }
            }
            else
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Restoring conversation with cid : [{0}]", conversation.getId());
                }

                //Conversation must be used by one thread at a time
                ConversationImpl owbConversation = (ConversationImpl)conversation;
                if(!owbConversation.getInUsed().compareAndSet(false, true))
View Full Code Here

Examples of javax.enterprise.context.Conversation

        if (conversationContext == null)
        {
            return;
        }

        Conversation conversation = conversationManager.getConversationBeanReference();

        if (conversation == null)
        {
            return;
        }

        if (conversation.isTransient())
        {
            if (logger.isLoggable(Level.FINE))
            {
                logger.log(Level.FINE, "Destroying the transient conversation context with cid : [{0}]", conversation.getId());
            }
            destroyConversationContext();
        }
        else
        {
View Full Code Here

Examples of javax.enterprise.context.Conversation

    @SuppressWarnings("unchecked")
    public Conversation getConversationBeanReference()
    {
        BeanManager beanManager = webBeansContext.getBeanManagerImpl();
        Bean<Conversation> bean = (Bean<Conversation>)beanManager.getBeans(Conversation.class, new DefaultLiteral()).iterator().next();
        Conversation conversation =(Conversation) beanManager.getReference(bean, Conversation.class, beanManager.createCreationalContext(bean));

        return conversation;
    }
View Full Code Here

Examples of javax.enterprise.context.Conversation

                return;
            }

            WebBeansContext webBeansContext = WebBeansContext.getInstance();
            ConversationManager conversationManager = webBeansContext.getConversationManager();
            Conversation conversation = conversationManager.getConversationBeanReference();

            if (conversation.isTransient())
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Destroying the conversation context with cid : [{0}]", conversation.getId());
                }
                ContextFactory contextFactory = webBeansContext.getContextFactory();
                contextFactory.destroyConversationContext();
            }
            else
View Full Code Here

Examples of javax.enterprise.context.Conversation

            //It looks for cid parameter in the JSF request.
            //If request contains cid, then it must restore conversation
            //Otherwise create NonexistentException
            WebBeansContext webBeansContext = WebBeansContext.getInstance();
            ConversationManager conversationManager = webBeansContext.getConversationManager();
            Conversation conversation = conversationManager.getConversationBeanReference();
            String cid = JSFUtil.getConversationId();
            ContextFactory contextFactory = webBeansContext.getContextFactory();

            if (conversation.isTransient())
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Creating a new transitional conversation with cid : [{0}]", conversation.getId());
                }
                contextFactory.initConversationContext(null);

                //Not restore, throw exception
                if(cid != null && !cid.equals(""))
                {
                    throw new NonexistentConversationException("Propogated conversation with cid=" + cid + " is not restored. It creates a new transient conversation.");
                }
            }
            else
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Restoring conversation with cid : [{0}]", conversation.getId());
                }

                //Conversation must be used by one thread at a time
                ConversationImpl owbConversation = (ConversationImpl)conversation;
                if(!owbConversation.getInUsed().compareAndSet(false, true))
View Full Code Here

Examples of net.kano.joustsim.oscar.oscar.service.icbm.Conversation

        }
        else {
          if (message.length() > 2048) {
            message = message.substring(0, 2048);
          }
          Conversation conv = _conn.getIcbmService().getImConversation(buddyInfo.getScreenname());
          conv.open();
          conv.sendMessage(new SimpleMessage(message));
        }
      }
    }
  }
View Full Code Here

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

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

        if (restart != null && restart.booleanValue())
        {
            FrameworkAdapter.getCurrentInstance().getBean(conversationName);
View Full Code Here

Examples of org.bukkit.conversations.Conversation

        if(!(sender instanceof Player))
            throw new CommandException("Can only add CommandItems as a player!");
        if(((Player) sender).getInventory().getItemInHand() == null)
            throw new CommandException("Invalid Item for CommandItems!");
        Conversation convo = conversationFactory.buildConversation((Conversable) sender);
        convo.getContext().setSessionData("item", ((HumanEntity) sender).getInventory().getItemInHand());
        List<ItemStack> consumables = new ArrayList<ItemStack>();
        for(int i = 0; i <= 8; i++) {
            if(i == ((HumanEntity) sender).getInventory().getHeldItemSlot())
                continue;
            ItemStack stack = ((HumanEntity) sender).getInventory().getItem(i);
            if(!ItemUtil.isStackValid(stack))
                continue;
            consumables.add(stack);
        }
        convo.getContext().setSessionData("consumables", consumables);

        convo.begin();
    }
View Full Code Here

Examples of org.drools.grid.io.Conversation


        ConversationManager cm = new ConversationManagerImpl( new GridImpl("peer"),
                                                              l );

        Conversation cv = cm.startConversation( "s1",
                                                new InetSocketAddress( "127.0.0.1",
                                                                       8000 ),
                                                                       "r1" );

        BlockingMessageResponseHandler blockHandler = new BlockingMessageResponseHandler();

        cv.sendMessage( "hello",
                        blockHandler );

        Message msg = blockHandler.getMessage(100, 5000 );
        System.out.println( msg.getBody() );

        cv.endConversation();
        if ( acc.isOpen() ) {
            acc.close();
        }
        assertEquals( false,
                      acc.isOpen() );
View Full Code Here

Examples of org.eclipse.bpmn2.Conversation

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.CONVERSATION: {
            Conversation conversation = (Conversation) theEObject;
            T result = caseConversation(conversation);
            if (result == null)
                result = caseConversationNode(conversation);
            if (result == null)
                result = caseBaseElement(conversation);
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.