@Override public long readLong() throws JMSException { return message.readLong(); }
public long readLong() throws JMSException { return ((BytesMessage) message).readLong(); }
public long readLong() throws JMSException { return ((BytesMessage) message).readLong(); }
/** * Read * @return The value * @exception JMSException Thrown if an error occurs */ public long readLong() throws JMSException { if (_log.isTraceEnabled()) { _log.trace("readLong()"); } return ((BytesMessage)_message).readLong(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public long readLong() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readLong()"); } return ((BytesMessage) message).readLong(); }
/** * Read * * @return The value * @throws JMSException Thrown if an error occurs */ @Override public long readLong() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("readLong()"); } return ((BytesMessage) message).readLong(); }
@Override @SuppressWarnings("rawtypes") public long getCommittedWindowId(String appId, int operatorId) { logger.debug("Getting committed windowId appId {} operatorId {}", appId, operatorId); try { beginTransaction(); BytesMessage message = (BytesMessage)consumer.receive(); logger.debug("Retrieved committed window messageId: {}, messageAppOperatorIdProp: {}", message.getJMSMessageID(), message.getStringProperty(APP_OPERATOR_ID)); long windowId = message.readLong(); writeWindowId(appId, operatorId, windowId); commitTransaction(); logger.debug("metaQueueName: " + metaQueueName); logger.debug("Retrieved windowId {}", windowId); return windowId; } catch (JMSException ex) { throw new RuntimeException(ex); } }
values[i] = Integer.valueOf(message.readInt()); } else if (long.class.equals(parameterType)) { values[i] = message.readLong(); } else if (Long.class.equals(parameterType)) { values[i] = Long.valueOf(message.readLong()); } else if (float.class.equals(parameterType)) { values[i] = message.readFloat();
values[i] = Integer.valueOf(message.readInt()); } else if (long.class.equals(parameterType)) { values[i] = message.readLong(); } else if (Long.class.equals(parameterType)) { values[i] = Long.valueOf(message.readLong()); } else if (float.class.equals(parameterType)) { values[i] = message.readFloat();
@Test public void testReceiveBytes() throws Exception { JMSProducer producer = context.createProducer(); JMSConsumer consumer = context.createConsumer(queue1); BytesMessage bytesSend = context.createBytesMessage(); bytesSend.writeByte((byte) 1); bytesSend.writeLong(2L); producer.send(queue1, bytesSend); BytesMessage msgReceived = (BytesMessage) consumer.receiveNoWait(); byte[] bytesArray = msgReceived.getBody(byte[].class); assertEquals((byte) 1, msgReceived.readByte()); assertEquals(2L, msgReceived.readLong()); DataInputStream dataInputStream = new DataInputStream(new ByteArrayInputStream(bytesArray)); assertEquals((byte) 1, dataInputStream.readByte()); assertEquals(2L, dataInputStream.readLong()); }
return longMessage.readLong(); case SHORT: if (!(message instanceof BytesMessage)) {
@Override protected void assertEquivalent(final Message m, final int mode, final boolean redelivered) throws JMSException { super.assertEquivalent(m, mode, redelivered); BytesMessage bm = (BytesMessage) m; ProxyAssertSupport.assertEquals(true, bm.readBoolean()); ProxyAssertSupport.assertEquals((byte) 3, bm.readByte()); byte[] bytes = new byte[3]; bm.readBytes(bytes); ProxyAssertSupport.assertEquals((byte) 4, bytes[0]); ProxyAssertSupport.assertEquals((byte) 5, bytes[1]); ProxyAssertSupport.assertEquals((byte) 6, bytes[2]); ProxyAssertSupport.assertEquals((char) 7, bm.readChar()); ProxyAssertSupport.assertEquals(new Double(8.0), new Double(bm.readDouble())); ProxyAssertSupport.assertEquals(new Float(9.0), new Float(bm.readFloat())); ProxyAssertSupport.assertEquals(10, bm.readInt()); ProxyAssertSupport.assertEquals(11L, bm.readLong()); ProxyAssertSupport.assertEquals((short) 12, bm.readShort()); ProxyAssertSupport.assertEquals("this is an UTF String", bm.readUTF()); }
assertEquals(99999L, bytesMessage.readLong()); assertEquals('h', bytesMessage.readChar()); assertEquals(987, bytesMessage.readInt());
m.readLong(); ProxyAssertSupport.fail(); } catch (javax.jms.MessageNotReadableException e) { ProxyAssertSupport.assertEquals(myChar, m2.readChar()); ProxyAssertSupport.assertEquals(myInt, m2.readInt()); ProxyAssertSupport.assertEquals(myLong, m2.readLong()); ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0); ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0); ProxyAssertSupport.assertEquals(myShort, m2.readShort()); ProxyAssertSupport.assertEquals(myInt, m2.readInt()); ProxyAssertSupport.assertEquals(myLong, m2.readLong()); ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0); ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0); m2.readLong(); ProxyAssertSupport.fail(); } catch (MessageEOFException e) {