Package com.caucho.jms.message

Examples of com.caucho.jms.message.MessageImpl


  {
    int msgType = rs.getInt(2);
    String msgId = rs.getString(3);
    boolean redelivered = rs.getInt(4) == 1;

    MessageImpl msg;
   
    switch (msgType) {
    case TEXT:
      {
  InputStream is = rs.getBinaryStream(5);

  try {
    msg = readTextMessage(is);
  } finally {
    if (is != null)
      is.close();
  }
  break;
      }
     
    case BYTES:
      {
  InputStream is = rs.getBinaryStream(5);

  try {
    msg = readBytesMessage(is);
  } finally {
    if (is != null)
      is.close();
  }
  break;
      }
     
    case STREAM:
      {
  InputStream is = rs.getBinaryStream(5);

  try {
    msg = readStreamMessage(is);
  } finally {
    if (is != null)
      is.close();
  }
  break;
      }
     
    case OBJECT:
      {
  InputStream is = rs.getBinaryStream(5);

  try {
    msg = readObjectMessage(is);
  } finally {
    if (is != null)
      is.close();
  }
  break;
      }
     
    case MAP:
      {
  InputStream is = rs.getBinaryStream(5);

  try {
    msg = readMapMessage(is);
  } finally {
    if (is != null)
      is.close();
  }
  break;
      }
     
    case MESSAGE:
    default:
      {
  msg = new MessageImpl();
  break;
      }
    }
   
    InputStream is = rs.getBinaryStream(6);
   
    if (is != null) {
      try {
  readMessageHeader(is, msg);
      } finally {
  is.close();
      }
    }

    msg.setJMSMessageID(msgId);
    msg.setJMSRedelivered(redelivered);

    return msg;
  }
View Full Code Here


      E payload = entry.getPayload();

      if (payload == null)
  return null;
     
      MessageImpl msg = null;

      if (payload instanceof MessageImpl) {
  msg = (MessageImpl) payload;
      }
      else if (payload instanceof String) {
  msg = new TextMessageImpl((String) payload);
  msg.setJMSMessageID(entry.getMsgId());
      }
      else {
  msg = new ObjectMessageImpl((Serializable) payload);
  msg.setJMSMessageID(entry.getMsgId());
      }

      msg.setReceive();
     
      /*if (_selector != null && ! _selector.isMatch(msg)) {
        _queue.acknowledge(msg.getJMSMessageID());
        continue;
      }*/
 
View Full Code Here

TOP

Related Classes of com.caucho.jms.message.MessageImpl

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.