public synchronized void decode(final ByteBuf buffer) { decode(buffer, null); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * I am keeping this synchronized as the decode of the Properties is lazy */ protected TypedProperties checkProperties() { if (properties == null) { TypedProperties properties = new TypedProperties(); if (buffer != null && propertiesLocation >= 0) { final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation); properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); } this.properties = properties; } return this.properties; }
private void decodeHeadersAndProperties(final ByteBuf buffer, boolean lazyProperties) { messageIDPosition = buffer.readerIndex(); messageID = buffer.readLong(); address = SimpleString.readNullableSimpleString(buffer, coreMessageObjectPools == null ? null : coreMessageObjectPools.getAddressDecoderPool()); if (buffer.readByte() == DataConstants.NOT_NULL) { byte[] bytes = new byte[16]; buffer.readBytes(bytes); userID = new UUID(UUID.TYPE_TIME_BASED, bytes); } else { userID = null; } type = buffer.readByte(); durable = buffer.readBoolean(); expiration = buffer.readLong(); timestamp = buffer.readLong(); priority = buffer.readByte(); if (lazyProperties) { properties = null; propertiesLocation = buffer.readerIndex(); } else { properties = new TypedProperties(); properties.decode(buffer, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); } }
public void decode(final ByteBuf buffer) { decode(buffer, null); }
public void decode(final ByteBuf buffer) { decode(buffer, null); }
public void decode(final ByteBuf buffer) { decode(buffer, null); }
public void decode(final ByteBuf buffer) { decode(buffer, null); }
public void decode(final ByteBuf buffer) { decode(buffer, null); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * Utility method to set the map on a message body */ public static void readBodyMap(ActiveMQBuffer message, TypedProperties map) { message.resetReaderIndex(); map.decode(message.byteBuf()); }
/** * I am keeping this synchronized as the decode of the Properties is lazy */ protected TypedProperties checkProperties() { if (properties == null) { TypedProperties properties = new TypedProperties(); if (buffer != null && propertiesLocation >= 0) { final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation); properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); } this.properties = properties; } return this.properties; }
private synchronized TypedProperties getOrInitializeTypedProperties() { try { TypedProperties properties = this.properties; if (properties == null) { properties = new TypedProperties(INTERNAL_PROPERTY_NAMES_PREDICATE); if (buffer != null && propertiesLocation >= 0) { final ByteBuf byteBuf = buffer.duplicate().readerIndex(propertiesLocation); properties.decode(byteBuf, coreMessageObjectPools == null ? null : coreMessageObjectPools.getPropertiesDecoderPools()); } this.properties = properties; } return properties; } catch (Throwable e) { throw onCheckPropertiesError(e); } }
@Override public Message decode(ActiveMQBuffer buffer, Message record) { AMQPMessage message = (AMQPMessage)super.decode(buffer, record); int size = buffer.readInt(); if (size != 0) { TypedProperties properties = new TypedProperties(); properties.decode(buffer.byteBuf()); message.setExtraProperties(properties); } return message; }
@Override public Message decode(ActiveMQBuffer buffer, Message record) { AMQPMessage message = (AMQPMessage)super.decode(buffer, record); int size = buffer.readInt(); if (size != 0) { TypedProperties properties = new TypedProperties(); properties.decode(buffer.byteBuf()); message.setExtraProperties(properties); } return message; }
@Test public void testEncodeDecodeEmpty() throws Exception { TypedProperties emptyProps = new TypedProperties(); ActiveMQBuffer buffer = ActiveMQBuffers.dynamicBuffer(1024); emptyProps.encode(buffer.byteBuf()); Assert.assertEquals(props.getEncodeSize(), buffer.writerIndex()); TypedProperties decodedProps = new TypedProperties(); decodedProps.decode(buffer.byteBuf()); TypedPropertiesTest.assertEqualsTypeProperties(emptyProps, decodedProps); }