Examples of clearBody()


Examples of javax.jms.BytesMessage.clearBody()

      int unsignedShort = m2.readUnsignedShort();

      ProxyAssertSupport.assertEquals((int)(myShort & 0xFFFF), unsignedShort);

      m2.clearBody();

      try
      {
         m2.getBodyLength();
         ProxyAssertSupport.fail();
View Full Code Here

Examples of javax.jms.MapMessage.clearBody()

      }
      catch (MessageFormatException e)
      {
      }

      m2.clearBody();

      ProxyAssertSupport.assertFalse(m2.getMapNames().hasMoreElements());

      // Test String -> Numeric and bool conversions
      MapMessage m3 = (MapMessage)queueProducerSession.createMapMessage();
View Full Code Here

Examples of javax.jms.Message.clearBody()

  }
 
  public void testClearBody() throws Exception
  {
    Message msg = new EmptyMessageImpl();
    msg.clearBody();
  }
}
View Full Code Here

Examples of javax.jms.ObjectMessage.clearBody()

      }
      catch (MessageNotWriteableException e)
      {
      }

      m4.clearBody();

      m4.setObject(obj);

      TestSerializable obj4 = (TestSerializable)m4.getObject();
View Full Code Here

Examples of javax.jms.StreamMessage.clearBody()

                public void onMessage(Message message)
                {
                    final StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        // it is legal to extend a stream message's content
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (Throwable t)
                    {
View Full Code Here

Examples of javax.jms.StreamMessage.clearBody()

      ProxyAssertSupport.assertEquals(myLong, m2.readLong());
      ProxyAssertSupport.assertEquals(myFloat, m2.readFloat(), 0);
      ProxyAssertSupport.assertEquals(myDouble, m2.readDouble(), 0);
      ProxyAssertSupport.assertEquals(myString, m2.readString());

      m2.clearBody();

      try
      {
         // Should now be write only
         m2.readBoolean();
View Full Code Here

Examples of javax.jms.StreamMessage.clearBody()

                public void onMessage(Message message)
                {
                    StreamMessage sm = (StreamMessage) message;
                    try
                    {
                        sm.clearBody();
                        sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
                    }
                    catch (JMSException e)
                    {
                        _logger.error("Error when writing large string to received msg: " + e, e);
View Full Code Here

Examples of javax.jms.TextMessage.clearBody()

        tm = (TextMessage) consumer1.receive(10000L);
        assertNotNull(tm);
        session1.commit();
        msgText = tm.getText();
        assertNull(msgText);
        tm.clearBody();
        tm.setText("Now we are not null");
        publisher.publish(tm);
        session1.commit();
        tm = (TextMessage) consumer1.receive(2000);
        assertNotNull(tm);
View Full Code Here

Examples of javax.jms.TextMessage.clearBody()

      }
      catch (MessageNotWriteableException e)
      {
      }

      m2.clearBody();
      ProxyAssertSupport.assertNull(m2.getText());
      m2.setText("Now it is read-write");
   }

   // Package protected ---------------------------------------------
View Full Code Here

Examples of javax.jms.TextMessage.clearBody()

                try {
                    TextMessage textMsg = (TextMessage)msg;
                    String payload = "REPLY: " + textMsg.getText();
                    Destination replyTo;
                    replyTo = msg.getJMSReplyTo();
                    textMsg.clearBody();
                    textMsg.setText(payload);
                    remoteProducer.send(replyTo, textMsg);
                } catch (JMSException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.