Package org.objectweb.joram.shared.messages

Examples of org.objectweb.joram.shared.messages.Message


      logger.log(BasicLevel.DEBUG, "DistributionTopic. preProcess(" + from + ", " + cm + ')');
    }
    List msgs = cm.getMessages();
    DMQManager dmqManager = null;
    for (int i = 0; i < msgs.size(); i++) {
      Message msg = (Message) msgs.get(i);
      try {
        distributionModule.processMessage(msg);
        nbMsgsDeliverSinceCreation++;
      } catch (Exception exc) {
        if (logger.isLoggable(BasicLevel.WARN)) {
View Full Code Here


      if (logger.isLoggable(BasicLevel.DEBUG))
        logger.log(BasicLevel.DEBUG,
                   "--- " + this + " initialize : transferTable = " + transferTable);

      for (Enumeration e = transferTable.elements(); e.hasMoreElements(); ) {
        Message msg = (Message) e.nextElement();
        FtpMessage ftpMsg = new FtpMessage(msg);
        FtpThread t = new FtpThread(transfer,
                                    (FtpMessage) ftpMsg.clone(),
                                    getId(),
                                    dmq,
View Full Code Here

  private void ftpNot(FtpNot not) {
    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG, "--- " + this +
                 " ftpNot(" + not + ")\n" +
                 "transferTable = " + transferTable);
    Message msg = (Message) not.getMessages().get(0);
    storeMessage(new org.objectweb.joram.mom.messages.Message(msg));
    deliverMessages(0);
    transferTable.remove(new FtpMessage(msg).getIdentifier());

    if (logger.isLoggable(BasicLevel.DEBUG))
View Full Code Here

    if (logger.isLoggable(BasicLevel.DEBUG))
      logger.log(BasicLevel.DEBUG,
                 "--- " + this + " preProcess : not.getMessages = " + not.getMessages().size());

    for (Iterator msgs = not.getMessages().iterator(); msgs.hasNext();) {
      Message msg = (Message) msgs.next();
      if (isFtpMsg(msg)) {
        doProcessFtp(not, msg);
        msgs.remove();
      }
    }
View Full Code Here

  public Object getObjectProperty(String key) {
    return sharedMsg.properties.get(key);
  }
 
  public Object clone() {
    Message cloneShared = (Message) sharedMsg.clone();
    return new FtpMessage(cloneShared);
  }
View Full Code Here

    }
    Properties prop = new Properties();
    prop.put(URL, urlStr);

    List list = new ArrayList(1);
    Message msg = new Message();

    msg.body = getResource(urlStr, prop);
    msg.properties = prop;
    msg.type = type;
View Full Code Here

      for (int i = 0; i < msgs.length; i++) {
        if (logger.isLoggable(BasicLevel.DEBUG)) {
          logger.log(BasicLevel.DEBUG, "--- " + this + " doPop : msgs[" + i + "] = " + msgs[i]);
        }
        try {
          Message msg = new Message();
          msg.setText(getBody(msgs[i]));
          msg.type = Message.TEXT;

          if (logger.isLoggable(BasicLevel.DEBUG)) {
            logger.log(BasicLevel.DEBUG, "--- " + this + " doPop : storeMessage m = " + msg);
          }
View Full Code Here

      this.name = name;
    }

    public void handleDelivery(String consumerTag, Envelope envelope, BasicProperties properties, byte[] body)
        throws IOException {
      Message message = new Message();
      message.body = body;
      try {
        message.type = Byte.parseByte(properties.getType());
      } catch (NumberFormatException nfe) {
        if (logger.isLoggable(BasicLevel.WARN)) {
          logger.log(BasicLevel.WARN, "Message Type field could not be parsed.", nfe);
        }
        message.type = Message.BYTES;
      }
      message.correlationId = properties.getCorrelationId();
      Integer deliveryMode = properties.getDeliveryMode();
      if (deliveryMode != null) {
        if (deliveryMode.intValue() == 1) {
          message.persistent = false;
        } else if (deliveryMode.intValue() == 2) {
          message.persistent = true;
        }
      }
      if (properties.getPriority() != null)
        message.priority = properties.getPriority().intValue();
      if (properties.getTimestamp() != null)
        message.timestamp = properties.getTimestamp().getTime();

      try {
        if (properties.getExpiration() != null)
          message.expiration = Long.parseLong(properties.getExpiration());
      } catch (NumberFormatException nfe) {
        if (logger.isLoggable(BasicLevel.WARN)) {
          logger.log(BasicLevel.WARN, "Expiration field could not be parsed.", nfe);
        }
      }

      if (properties.getHeaders() != null) {
        Map<String, Object> props = properties.getHeaders();
        for (Map.Entry<String, Object> prop : props.entrySet()) {
          try {
            if (prop.getValue() instanceof LongString) {
              message.setProperty(prop.getKey(), prop.getValue().toString());
            } else {
              message.setProperty(prop.getKey(), prop.getValue());
            }
          } catch (ClassCastException exc) {
            if (logger.isLoggable(BasicLevel.ERROR)) {
              logger.log(BasicLevel.ERROR, "Property can't be mapped to JMS message property.", exc);
            }
View Full Code Here

              }
            }
          }
          org.objectweb.joram.client.jms.Message clientMessage = org.objectweb.joram.client.jms.Message
              .convertJMSMessage(jmsMessage);
          Message momMessage = clientMessage.getMomMsg();

          transmitter.transmit(momMessage, jmsMessage.getJMSMessageID());

          if (isXA) {
            try {
View Full Code Here

    // If sender is not a writer, sending the messages to the DMQ, and
    // throwing an exception:
    if (!isWriter(from)) {
      DMQManager dmqManager = new DMQManager(not.getDMQId(), dmqId, getId());
      Message msg;
      for (Iterator msgs = not.getMessages().iterator(); msgs.hasNext();) {
        msg = (Message) msgs.next();
        nbMsgsSentToDMQSinceCreation++;
        dmqManager.addDeadMessage(msg, MessageErrorConstants.NOT_WRITEABLE);
        handleDeniedMessage(msg.id, AgentId.fromString(msg.replyToId));
View Full Code Here

TOP

Related Classes of org.objectweb.joram.shared.messages.Message

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.