示例#1
0
 public void encodeHeadersAndProperties(final HornetQBuffer buffer) {
   buffer.writeLong(messageID);
   buffer.writeNullableSimpleString(address);
   if (userID == null) {
     buffer.writeByte(DataConstants.NULL);
   } else {
     buffer.writeByte(DataConstants.NOT_NULL);
     buffer.writeBytes(userID.asBytes());
   }
   buffer.writeByte(type);
   buffer.writeBoolean(durable);
   buffer.writeLong(expiration);
   buffer.writeLong(timestamp);
   buffer.writeByte(priority);
   properties.encode(buffer);
 }
 @Override
 public void encodeRest(final HornetQBuffer buffer) {
   buffer.writeBoolean(synchronizationIsFinished);
   buffer.writeBoolean(allowsAutoFailBack);
   buffer.writeString(nodeID);
   if (synchronizationIsFinished) return;
   buffer.writeByte(dataType.code);
   buffer.writeInt(ids.length);
   for (long id : ids) {
     buffer.writeLong(id);
   }
 }
示例#3
0
  public HornetQBuffer encode(final RemotingConnection connection) {
    HornetQBuffer buffer = connection.createBuffer(PacketImpl.INITIAL_PACKET_SIZE);

    // The standard header fields

    buffer.writeInt(0); // The length gets filled in at the end
    buffer.writeByte(type);
    buffer.writeLong(channelID);

    encodeRest(buffer);

    size = buffer.writerIndex();

    // The length doesn't include the actual length byte
    int len = size - DataConstants.SIZE_INT;

    buffer.setInt(0, len);

    return buffer;
  }
示例#4
0
文件: Ping.java 项目: fharms/hornetq
 @Override
 public void encodeRest(final HornetQBuffer buffer) {
   buffer.writeLong(connectionTTL);
 }