Examples of Conversation


Examples of com.restfb.types.Conversation

  /**
   * test reading in a sample page conversation
   */
  @Test
  public void conversation() {
    Conversation conversation = createJsonMapper().toJavaObject(jsonFromClasspath("conversation"), Conversation.class);
    assertEquals("t_id.378684585488220", conversation.getId());

    List<Message> messages = conversation.getMessages();
    assertEquals(2, messages.size());

    List<Message.Attachment> attachments = messages.get(0).getAttachments();
    assertEquals(2, attachments.size());
    assertNull(attachments.get(0).getImageData());
View Full Code Here

Examples of com.zhangwoo.spider.po.Conversation

    try {
      NodeList cons = (NodeList) xpath.evaluate(
          "//TABLE[@width='349' and @height='210']", docHtml,
          XPathConstants.NODESET);
      for (int i = 0; i < cons.getLength(); i++) {
        Conversation result = new Conversation();
        result.setContent(xpath.evaluate(
            "//TABLE[@width='349' and @height='210']",
                cons.item(i)));
        System.out.println(xpath.evaluate(
            "//TABLE[@width='349' and @height='210']",
                cons.item(i)));
View Full Code Here

Examples of conversation.Conversation

    private static Settings settings;
   
   
    public ChatEngine(){
      this.settings=new Settings();
      conversation = new Conversation();
      connectWindow = new ConnectWindow();
        infoWindow = new InfoWindow();
        settingsWindow = new SettingsWindow();
        mainWindow = new MainWindow();
       
View Full Code Here

Examples of javax.context.Conversation

    public Conversation createNewConversation(String viewId)
    {
        Asserts.assertNotNull(viewId, "viewId parameter can not be null");

        Conversation conversation = getCurrentConversation();
        ((ConversationImpl) conversation).setViewId(viewId);

        // Create conversation context
        // ContextFactory.initConversationContext();
View Full Code Here

Examples of javax.enterprise.context.Conversation

                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);
                }
            }
View Full Code Here

Examples of javax.enterprise.context.Conversation

        // ----- execute
        // create conversation
        ConversationContext conversationContext = new ConversationContext();
        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);
View Full Code Here

Examples of javax.enterprise.context.Conversation

   *
   * this method allows to start a conversation if no conversation is active
   */
  public Task startTask(String taskId, boolean beginConversation) {
    if(beginConversation) {
      Conversation conversation = conversationInstance.get();
      if(conversation.isTransient()) {
       conversation.begin();
      }
    }
    return startTask(taskId);
  }
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

            {
                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);
                }
            }
        }
View Full Code Here

Examples of javax.enterprise.context.Conversation

        if (phaseEvent.getPhaseId().equals(PhaseId.RENDER_RESPONSE) ||
                phaseEvent.getFacesContext().getResponseComplete())
        {
            WebBeansContext webBeansContext = WebBeansContext.getInstance();
            ConversationManager conversationManager = webBeansContext.getConversationManager();
            Conversation conversation = conversationManager.getConversationBeanReference();
            ContextFactory contextFactory = webBeansContext.getContextFactory();

            if (conversation.isTransient())
            {
                if (logger.isLoggable(Level.FINE))
                {
                    logger.log(Level.FINE, "Destroying the conversation context with cid : [{0}]", conversation.getId());
                }
                contextFactory.destroyConversationContext();
            }
            else
            {
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.