com.waveset.util.jms
Class JmsTopicWriter

java.lang.Object
  extended bycom.waveset.util.jms.JmsWriterBase
      extended bycom.waveset.util.jms.JmsTopicWriter
All Implemented Interfaces:
JmsWriter

public class JmsTopicWriter
extends JmsWriterBase


Field Summary
 
Fields inherited from class com.waveset.util.jms.JmsWriterBase
_connection, _session
 
Constructor Summary
JmsTopicWriter(java.util.Map configOptions)
           
 
Method Summary
 void write(javax.jms.Message message, java.util.Map writeOptions)
          Write a message.
 void writeAndClose(javax.jms.Message message, java.util.Map writeOptions)
           
 
Methods inherited from class com.waveset.util.jms.JmsWriterBase
close, commit, createBytesMessage, createMapMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, isTransacted, rollback, setConnection, setSession, writeAndCommit, writeAndCommitAndClose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsTopicWriter

public JmsTopicWriter(java.util.Map configOptions)
               throws WavesetException
Method Detail

write

public void write(javax.jms.Message message,
                  java.util.Map writeOptions)
           throws WavesetException,
                  javax.jms.JMSException
Description copied from interface: JmsWriter
Write a message.

Use this method if the JmsWriter is not transacted. If transacted, you can use this method when you wish to send multiple Messages within the same transaction .

NOTE: If transacted, the message will not truly be sent until commit() is called.

Parameters:
message - the message to be sent
writeOptions - Specify a non-null writeOptions map if you need to specify delivery mode, priority and time to live options.

The table below describes each expected key for the writeOptions map, and the significance of each key's value.

KeyValue typeReqd?UsageDefault
"deliveryMode" java.lang.String no Valid values are "PERSISTENT" and "NON_PERSISTENT" "PERSISTENT"
"priority" java.lang.String or java.lang.Integer no The message priority for this message. Priority must be a value between 0 and 9.

JMS defines a 10 level priority value with 0 as the lowest and 9 as the highest. Clients should consider 0-4 as gradients of normal priority and 5-9 as gradients of expedited priority. Priority is set to 4, by default.

4
"timeToLive" java.lang.String or java.lang.Integer no The length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. zero is unlimited. 0
Throws:
javax.jms.JMSException - if JMS fails to send the message due to some internal error
WavesetException - if illegal values are found in writeOptions map

writeAndClose

public void writeAndClose(javax.jms.Message message,
                          java.util.Map writeOptions)
                   throws javax.jms.JMSException,
                          WavesetException
Overrides:
writeAndClose in class JmsWriterBase
Throws:
javax.jms.JMSException
WavesetException