Codota Logo
TextMessage.clearBody
Code IndexAdd Codota to your IDE (free)

How to use
clearBody
method
in
javax.jms.TextMessage

Best Java code snippets using javax.jms.TextMessage.clearBody (Showing top 6 results out of 315)

  • Common ways to obtain TextMessage
private void myMethod () {
TextMessage t =
  • Codota IconSession session;String text;session.createTextMessage(text)
  • Codota IconSession session;session.createTextMessage()
  • Codota IconQueueSession senderSession;senderSession.createTextMessage()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.servlet.http.HttpServlet;
import javax.ws.rs.Consumes;
import javax.ws.rs.PUT;
import javax.ws.rs.core.MediaType;

public class MessageServlet extends HttpServlet {

  @PUT
  @Consumes(MediaType.TEXT_PLAIN)
  public void putString(String myString) throws JMSException {
    MessageProducer producer = (MessageProducer) getServletContext()
        .getAttribute(MyContextListener.ACTIVE_MQ_PRODUCER);

    Session session = (Session) getServletContext().getAttribute(
        MyContextListener.ACTIVE_MQ_SESSION);
    TextMessage txtmessage = session.createTextMessage();
    if (txtmessage != null && producer != null) {
      txtmessage.clearBody();
      txtmessage.setText(myString);
      producer.send(txtmessage);
    }
  }
}
origin: objectweb-joramtests/joramtests

/**
* Test that the <code>TextMessage.clearBody()</code> effectively clear the body of the message
*/
public void testClearBody_1()
{
 try
 {
   TextMessage message = senderSession.createTextMessage();
   message.setText("bar");
   message.clearBody();
   assertEquals("3 .11.1 the clearBody method of Message resets the value of the message body "
      + "to the 'empty' initial message value as set by the message type's create "
      + "method provided by Session.\n", null, message.getText());
 }
 catch (JMSException e)
 {
   fail(e);
 }
}
origin: objectweb-joramtests/joramtests

/**
* Test that the <code>TextMessage.clearBody()</code> method does nto clear the 
* message properties.
*/
public void testClearBody_2()
{
 try
 {
   TextMessage message = senderSession.createTextMessage();
   message.setStringProperty("prop", "foo");
   message.clearBody();
   assertEquals("3.11.1 Clearing a message's body does not clear its property entries.\n", "foo", message
      .getStringProperty("prop"));
 }
 catch (JMSException e)
 {
   fail(e);
 }
}
origin: apache/activemq-artemis

m2.clearBody();
ProxyAssertSupport.assertNull(m2.getText());
m2.setText("Now it is read-write");
origin: apache/activemq-artemis

/**
* Test that the <code>TextMessage.clearBody()</code> effectively clear the body of the message
*/
@Test
public void testClearBody_1() {
 try {
   TextMessage message = senderSession.createTextMessage();
   message.setText("bar");
   message.clearBody();
   Assert.assertEquals("sec. 3 .11.1 the clearBody method of Message resets the value of the message body " + "to the 'empty' initial message value as set by the message type's create " + "method provided by Session.\n", null, message.getText());
 } catch (JMSException e) {
   fail(e);
 }
}
origin: apache/activemq-artemis

/**
* Test that the <code>TextMessage.clearBody()</code> method does not clear the
* message properties.
*/
@Test
public void testClearBody_2() {
 try {
   TextMessage message = senderSession.createTextMessage();
   message.setStringProperty("prop", "foo");
   message.clearBody();
   Assert.assertEquals("sec. 3.11.1 Clearing a message's body does not clear its property entries.\n", "foo", message.getStringProperty("prop"));
 } catch (JMSException e) {
   fail(e);
 }
}
javax.jmsTextMessageclearBody

Popular methods of TextMessage

  • getText
    Gets the string containing this message's data. The default value is null.
  • setText
    Sets the string containing this message's data.
  • setStringProperty
  • setJMSCorrelationID
  • setIntProperty
  • setLongProperty
  • getStringProperty
  • setBooleanProperty
  • setJMSReplyTo
  • getJMSCorrelationID
  • getJMSMessageID
  • getJMSReplyTo
  • getJMSMessageID,
  • getJMSReplyTo,
  • setDoubleProperty,
  • acknowledge,
  • setJMSType,
  • getJMSDeliveryMode,
  • setObjectProperty,
  • getIntProperty,
  • getJMSPriority

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now