@Override public String getText() throws JMSException { ByteSequence content = getContent(); if (text == null && content != null) { text = decodeContent(content); setContent(null); setCompressed(false); } return text; }
@Override public String toString() { try { String text = this.text; if( text == null ) { text = decodeContent(getContent()); } if (text != null) { text = MarshallingSupport.truncate64(text); HashMap<String, Object> overrideFields = new HashMap<String, Object>(); overrideFields.put("text", text); return super.toString(overrideFields); } } catch (JMSException e) { } return super.toString(); } }
@Override public void storeContent() { try { ByteSequence content = getContent(); String text = this.text; if (content == null && text != null) { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { compressed = true; os = new DeflaterOutputStream(os); } DataOutputStream dataOut = new DataOutputStream(os); MarshallingSupport.writeUTF8(dataOut, text); dataOut.close(); setContent(bytesOut.toByteSequence()); } } catch (IOException e) { throw new RuntimeException(e); } }
@Override public String getText() throws JMSException { ByteSequence content = getContent(); if (text == null && content != null) { text = decodeContent(content); setContent(null); setCompressed(false); } return text; }
@Override public String getText() throws JMSException { ByteSequence content = getContent(); if (text == null && content != null) { text = decodeContent(content); setContent(null); setCompressed(false); } return text; }
@Override public String toString() { try { String text = this.text; if( text == null ) { text = decodeContent(getContent()); } if (text != null) { text = MarshallingSupport.truncate64(text); HashMap<String, Object> overrideFields = new HashMap<String, Object>(); overrideFields.put("text", text); return super.toString(overrideFields); } } catch (JMSException e) { } return super.toString(); } }
@Override public String getText() throws JMSException { ByteSequence content = getContent(); if (text == null && content != null) { text = decodeContent(content); setContent(null); setCompressed(false); } return text; }
@Override public String toString() { try { String text = this.text; if( text == null ) { text = decodeContent(getContent()); } if (text != null) { text = MarshallingSupport.truncate64(text); HashMap<String, Object> overrideFields = new HashMap<String, Object>(); overrideFields.put("text", text); return super.toString(overrideFields); } } catch (JMSException e) { } return super.toString(); } }
@Override public void storeContent() { try { ByteSequence content = getContent(); String text = this.text; if (content == null && text != null) { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { compressed = true; os = new DeflaterOutputStream(os); } DataOutputStream dataOut = new DataOutputStream(os); MarshallingSupport.writeUTF8(dataOut, text); dataOut.close(); setContent(bytesOut.toByteSequence()); } } catch (IOException e) { throw new RuntimeException(e); } }
@Override public String toString() { try { String text = this.text; if( text == null ) { text = decodeContent(getContent()); } if (text != null) { text = MarshallingSupport.truncate64(text); HashMap<String, Object> overrideFields = new HashMap<String, Object>(); overrideFields.put("text", text); return super.toString(overrideFields); } } catch (JMSException e) { } return super.toString(); } }
public String getText() throws JMSException { if (text == null && getContent() != null) { InputStream is = null; try { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes != null) { is = new ByteArrayInputStream(bodyAsBytes); if (isCompressed()) { is = new InflaterInputStream(is); } DataInputStream dataIn = new DataInputStream(is); text = MarshallingSupport.readUTF8(dataIn); dataIn.close(); setContent(null); setCompressed(false); } } catch (IOException ioe) { throw JMSExceptionSupport.create(ioe); } finally { if (is != null) { try { is.close(); } catch (IOException e) { // ignore } } } } return text; }
@Override public void storeContent() { try { ByteSequence content = getContent(); String text = this.text; if (content == null && text != null) { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { compressed = true; os = new DeflaterOutputStream(os); } DataOutputStream dataOut = new DataOutputStream(os); MarshallingSupport.writeUTF8(dataOut, text); dataOut.close(); setContent(bytesOut.toByteSequence()); } } catch (IOException e) { throw new RuntimeException(e); } }
@Override public void storeContent() { try { ByteSequence content = getContent(); String text = this.text; if (content == null && text != null) { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { compressed = true; os = new DeflaterOutputStream(os); } DataOutputStream dataOut = new DataOutputStream(os); MarshallingSupport.writeUTF8(dataOut, text); dataOut.close(); setContent(bytesOut.toByteSequence()); } } catch (IOException e) { throw new RuntimeException(e); } }
public void beforeMarshall(WireFormat wireFormat) throws IOException { super.beforeMarshall(wireFormat); ByteSequence content = getContent(); if (content == null && text != null) { ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); OutputStream os = bytesOut; ActiveMQConnection connection = getConnection(); if (connection != null && connection.isUseCompression()) { compressed = true; os = new DeflaterOutputStream(os); } DataOutputStream dataOut = new DataOutputStream(os); MarshallingSupport.writeUTF8(dataOut, this.text); dataOut.close(); setContent(bytesOut.toByteSequence()); } }
Binary result = null; if (message.getContent() != null) { ByteSequence contents = message.getContent();
Binary result = null; if (message.getContent() != null) { ByteSequence contents = message.getContent();