Package com.reignite.messaging.amf

Examples of com.reignite.messaging.amf.AMFMessage


   * @param responseBody
   *            the body to set in the out message.
   */
  public void setResponseBody(AMFMessageBody responseBody) {
    if (outMessage == null) {
      outMessage = new AMFMessage();
      outMessage.setVersion(inMessage.getVersion());
    }
    outMessage.getBodies().add(bodyInProcess, responseBody);
  }
View Full Code Here


  }

  @Override
  public Object readMessage() throws ClassNotFoundException, IOException, MessageIncompatibleException {
    // Read packet header
    AMFMessage message = new AMFMessage();
    int version = worker.readUnsignedShort();
    message.setVersion(version);

    if (worker.worksWith(message)) {
      // Read headers
      int headerCount = worker.readUnsignedShort();
      for (int i = 0; i < headerCount; i++) {
        message.getHeaders().add(readHeader());
      }

      // Read bodies
      int bodyCount = worker.readUnsignedShort();
      for (int i = 0; i < bodyCount; i++) {
        message.getBodies().add(readBody());
      }
    } else {
      throw new MessageIncompatibleException("Worker: " + worker.getClass().getCanonicalName()
          + " can't work with: " + message);
    }
View Full Code Here

TOP

Related Classes of com.reignite.messaging.amf.AMFMessage

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.