Examples of OutputMessage


Examples of com.mgreau.wwsmad.websocket.messages.OutputMessage

  }
 
  public void html5RenderedEvent(@Observes @Backend("html5") AsciidocMessageEvent event){
    logger.info("::event:: received html5 event message");
    OutputMessage html = buildOutputMessage(TypeFormat.html5, event);
   
    long start = System.currentTimeMillis();
    try {
      html.setContent(processor.renderAsDocument(event.msg.getAdocSource()));
      html.setTimeToRender(System.currentTimeMillis() - start);
    } catch (RuntimeException rEx) {
      logger.severe("processing error." + rEx.getCause().toString());
    }

    // send the new HTML version to all connected peers
View Full Code Here

Examples of com.mgreau.wwsmad.websocket.messages.OutputMessage

   *
   * @param event
   */
  public void dzslidesRenderedEvent(@Observes @Backend("dzslides") AsciidocMessageEvent event){
    logger.info("::event:: received dzslides event message");
    OutputMessage html = buildOutputMessage(TypeFormat.html5, event);
   
    final String templateDir = System.getProperty("jboss.server.data.dir")+"/asciidoctor-backends/slim/dzslides";
   
    long start = System.currentTimeMillis();
    try {
      html.setContent(processor.renderAsDocument(event.msg.getAdocSource(), "dzslides",
          new java.io.File(templateDir), event.msg.getPart()));
      html.setTimeToRender(System.currentTimeMillis() - start);
    } catch (RuntimeException rEx) {
      logger.severe("processing error." + rEx.toString());
    }
   
    // send the new HTML version to all connected peers
View Full Code Here

Examples of com.mgreau.wwsmad.websocket.messages.OutputMessage

  public void pdfRenderedEvent(@Observes @Backend("pdf") AsciidocMessageEvent event){
    //NOT YET IMPLEMENTED
  }
 
  private OutputMessage buildOutputMessage(TypeFormat type, AsciidocMessageEvent event){
    final OutputMessage html = new OutputMessage(type);
    html.setAdocId(event.id);
    html.setType(TypeMessage.output);
    html.setCurrentWriter(event.msg.getCurrentWriter());
    html.setAdocSource(event.msg.getAdocSource());
    html.setTimeToRender(-1);
    html.setDocHeader(checkHeader(event.msg
        .getAdocSource()));
   
    return html;
  }
View Full Code Here

Examples of com.nokia.dempsy.container.mocks.OutputMessage

      assertEquals("number of MP instances", 2, container.getProcessorCount());
      assertTrue("queue is empty", outputQueue.isEmpty());

      container.outputPass();
      OutputMessage out1 = (OutputMessage)serializer.deserialize((byte[]) outputQueue.poll(1000, TimeUnit.MILLISECONDS));
      OutputMessage out2 = (OutputMessage)serializer.deserialize((byte[]) outputQueue.poll(1000, TimeUnit.MILLISECONDS));

      assertTrue("messages received", (out1 != null) && (out2 != null));
      assertEquals("no more messages in queue", 0, outputQueue.size());

      // order of messages is not guaranteed, so we need to aggregate keys
      HashSet<String> messageKeys = new HashSet<String>();
      messageKeys.add(out1.getKey());
      messageKeys.add(out2.getKey());
      assertTrue("first MP sent output", messageKeys.contains("foo"));
      assertTrue("second MP sent output", messageKeys.contains("bar"));
   }
View Full Code Here

Examples of com.nokia.dempsy.container.mocks.OutputMessage

      {
         numOutputExecutions.incrementAndGet();
         try
         {
            blockAllOutput.await();
            return new OutputMessage(myKey, activationCount, invocationCount, outputCount++);
         }
         finally
         {
            numOutputExecutions.decrementAndGet();
         }
View Full Code Here

Examples of example.chat.OutputMessage

  @Override
  public void execute() {
    Player player = manager.getPlayer(message.getPlayerId());
    Player[] friends = player.getFriends();
    OutputMessage outMsg = MessageFactory.createSFriendListRsp(friends);
   
    player.putMessage(outMsg);
   
    player.flush();
   
View Full Code Here

Examples of example.chat.OutputMessage

  @Override
  public void execute() {
   
    Player player = manager.getPlayer(message.getPlayerId());
    OutputMessage outMsg = MessageFactory.createHearTbeatRsp();

   
   
    player.putMessage(outMsg);
   
View Full Code Here

Examples of example.chat.OutputMessage

    Player player = manager.getPlayer(message.getPlayerId());
   
    Player friend = manager.getPlayer(friendId);
   
    if(friend != null) {
      OutputMessage outMsg = MessageFactory.createSendMessage(msgstr);
      friend.putMessage(outMsg);
      friend.flush();
    }
   
    player.flush();
View Full Code Here

Examples of example.chat.OutputMessage

    Player friend = manager.getPlayer(friendId);
    if(friend != null) {
      player.addFriend(friend);
    }
   
    OutputMessage outMsg = MessageFactory.createAddFriendRsp(friend);
   
    player.putMessage(outMsg);
   
    player.flush();
  }
View Full Code Here

Examples of example.chat.OutputMessage

      player.setCheckTask(checktask);
     
      //设定定时检查,每十秒检查一次
      manager.getTimer().schedule(checktask, 10 * 1000, 10 * 1000);
     
      OutputMessage outMsg = MessageFactory.createSLoginRsp(validateCode);
      player.putMessage(outMsg);
     
     
      Player[] friends = player.getFriends();
      OutputMessage outMsg2 = MessageFactory.createSFriendListRsp(friends);
      player.putMessage(outMsg2);
     
      //通知所有朋友已经上线.
      OutputMessage outMsg3 = MessageFactory.createOnlineStatusNotify(player.getPlayerId(), true);
      for(int i=0; i<friends.length; i++) {
        friends[i].putMessage(outMsg3);
        friends[i].flush();
      }
     
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.