23.07.2013 Views

O'Reilly - Java Message Service

O'Reilly - Java Message Service

O'Reilly - Java Message Service

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Message</strong>FormatException<br />

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

Thrown when a JMS client attempts to use a data type not supported by a message,<br />

or attempts to read data in a message as the wrong type. Also thrown when type<br />

errors are made with message property values. Note that this exception should not be<br />

thrown when attempting to read improperly formatted String data as numeric values.<br />

java.lang.NumberFormatException should be used in this case.<br />

<strong>Message</strong>NotReadableException<br />

Thrown when a JMS client tries to read a write-only message.<br />

<strong>Message</strong>NotWriteableException<br />

Thrown when a JMS client tries to write to a read-only message.<br />

ResourceAllocationException<br />

Thrown when a provider is unable to allocate the resources required by a method.<br />

This exception should be thrown when a call to createTopicConnection( ) fails<br />

because the JMS provider has insufficient resources.<br />

TransactionInProgressException<br />

Thrown when an operation is invalid because a transaction is in progress. For<br />

instance, it should be thrown if you call Session.commit( ) when a session is part of<br />

a distributed transaction.<br />

TransactionRolledBackException<br />

Thrown when calling Session.commit( ) results in a transaction rollback.<br />

A.1.9 Map<strong>Message</strong><br />

This <strong>Message</strong> type carries a set of name-value pairs as its payload. The payload is similar to<br />

a java.util.Properties object, except the values must be <strong>Java</strong> primitives or their<br />

wrappers. The Map<strong>Message</strong> is useful for delivering keyed data:<br />

public interface Map<strong>Message</strong> extends <strong>Message</strong> {<br />

public boolean getBoolean(String name) throws JMSException;<br />

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

throws JMSException;<br />

public byte getByte(String name) throws JMSException;<br />

public void setByte(String name, byte value) throws JMSException;<br />

public byte[] getBytes(String name) throws JMSException;<br />

public void setBytes(String name, byte[] value)<br />

throws JMSException;<br />

public void setBytes(String name, byte[] value,<br />

int offset, int length)<br />

throws JMSException;<br />

public short getShort(String name) throws JMSException;<br />

public void setShort(String name, short value) throws JMSException;<br />

public char getChar(String name) throws JMSException;<br />

public void setChar(String name, char value) throws JMSException;<br />

public int getInt(String name) throws JMSException;<br />

145

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

Saved successfully!

Ooh no, something went wrong!