23.07.2013 Views

O'Reilly - Java Message Service

O'Reilly - Java Message Service

O'Reilly - Java Message Service

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

public String getStringProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setStringProperty(String name, String value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public int getIntProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setIntProperty(String name, int value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public boolean getBooleanProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setBooleanProperty(String name, boolean value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public double getDoubleProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setDoubleProperty(String name, double value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public float getFloatProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setFloatProperty(String name, float value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public byte getByteProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setByteProperty(String name, byte value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public long getLongProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setLongPreperty(String name, long value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public short getShortProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setShortProperty(String name, short value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public Object getObjectProperty(String name)<br />

throws JMSException, <strong>Message</strong>FormatException;<br />

public void setObjectProperty(String name, Object value)<br />

throws JMSException, <strong>Message</strong>NotWriteableException;<br />

public void clearProperties( )<br />

throws JMSException;<br />

public Enumeration getPropertyNames( )<br />

throws JMSException;<br />

public boolean propertyExists(String name)<br />

throws JMSException;<br />

A.1.11 <strong>Message</strong>Consumer<br />

<strong>Java</strong> <strong>Message</strong> <strong>Service</strong><br />

The <strong>Message</strong>Consumer is the base interface for the TopicSubscriber and the QueueReceiver.<br />

It defines several general-purpose methods used by clients when using a consumer. Among<br />

these methods are the set<strong>Message</strong>Listener( )and close( ) methods, and three types of<br />

receive( ) methods.<br />

<strong>Message</strong>Consumer can consume messages asynchronously or synchronously. To consume<br />

messages asynchronously, the JMS client must provide the <strong>Message</strong>Consumer with a<br />

<strong>Message</strong>Listener object, which will then receive the messages as they arrive. To consume<br />

messages synchronously, the JMS client may call one of three receive methods: receive(<br />

), receive(long timeout), and receiveNoWait( ):<br />

public interface <strong>Message</strong>Consumer {<br />

public void close( ) throws JMSException;<br />

public <strong>Message</strong>Listener get<strong>Message</strong>Listener( ) throws JMSException;<br />

public String get<strong>Message</strong>Selector( ) throws JMSException;<br />

public <strong>Message</strong> receive( ) throws JMSException;<br />

public <strong>Message</strong> receive(long timeout) throws JMSException;<br />

147

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!