@Override public void storeContent() { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes == null && object != null) { try { 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); ObjectOutputStream objOut = new ObjectOutputStream(dataOut); objOut.writeObject(object); objOut.flush(); objOut.reset(); objOut.close(); setContent(bytesOut.toByteSequence()); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } } }
if (object == null && getContent() != null) { try { ByteSequence content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) {
@Override public void storeContent() { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes == null && object != null) { try { 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); ObjectOutputStream objOut = new ObjectOutputStream(dataOut); objOut.writeObject(object); objOut.flush(); objOut.reset(); objOut.close(); setContent(bytesOut.toByteSequence()); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } } }
public void storeContent() { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes == null && object != null) { try { 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); ObjectOutputStream objOut = new ObjectOutputStream(dataOut); objOut.writeObject(object); objOut.flush(); objOut.reset(); objOut.close(); setContent(bytesOut.toByteSequence()); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } } }
@Override public void storeContent() { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes == null && object != null) { try { 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); ObjectOutputStream objOut = new ObjectOutputStream(dataOut); objOut.writeObject(object); objOut.flush(); objOut.reset(); objOut.close(); setContent(bytesOut.toByteSequence()); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } } }
@Override public void storeContent() { ByteSequence bodyAsBytes = getContent(); if (bodyAsBytes == null && object != null) { try { 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); ObjectOutputStream objOut = new ObjectOutputStream(dataOut); objOut.writeObject(object); objOut.flush(); objOut.reset(); objOut.close(); setContent(bytesOut.toByteSequence()); } catch (IOException ioe) { throw new RuntimeException(ioe.getMessage(), ioe); } } }
/** * Gets the serializable object containing this message's data. The default * value is null. * * @return the serializable object containing this message's data * @throws JMSException */ public Serializable getObject() throws JMSException { if (object == null && getContent() != null) { try { ByteSequence content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) { is = new InflaterInputStream(is); } DataInputStream dataIn = new DataInputStream(is); ClassLoadingAwareObjectInputStream objIn = new ClassLoadingAwareObjectInputStream(dataIn); try { object = (Serializable)objIn.readObject(); } catch (ClassNotFoundException ce) { throw JMSExceptionSupport.create("Failed to build body from content. Serializable class not available to broker. Reason: " + ce, ce); } finally { dataIn.close(); } } catch (IOException e) { throw JMSExceptionSupport.create("Failed to build body from bytes. Reason: " + e, e); } } return this.object; }
if (object == null && getContent() != null) { try { ByteSequence content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) {
if (object == null && getContent() != null) { try { ByteSequence content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) {
if (object == null && getContent() != null) { try { ByteSequence content = getContent(); InputStream is = new ByteArrayInputStream(content); if (isCompressed()) {
Binary result = null; if (message.getContent() != null) { ByteSequence contents = message.getContent();
Binary result = null; if (message.getContent() != null) { ByteSequence contents = message.getContent();