Joram 5.2.5

org.objectweb.joram.client.jms
Class MessageProducer

java.lang.Object
  extended by org.objectweb.joram.client.jms.MessageProducer
All Implemented Interfaces:
javax.jms.MessageProducer
Direct Known Subclasses:
QueueSender, TopicPublisher

public class MessageProducer
extends java.lang.Object
implements javax.jms.MessageProducer

Implements the javax.jms.MessageProducer interface.

A client uses a MessageProducer object to send messages to a destination. A MessageProducer object is created by calling the createProducer method on the session object. A message producer is normally dedicated to a unique destination.
A client also has the option of creating a message producer without supplying a unique destination. In this case, a destination must be provided with every send operation.
A client can specify a default delivery mode, priority, and time to live for messages sent by a message producer. It can also specify the delivery mode, priority, and time to live for each individual message.


Field Summary
protected  boolean closed
          true if the producer is closed.
protected  Destination dest
          The destination the producer sends messages to.
protected  Session sess
          The session the producer belongs to.
 
Method Summary
 void close()
          Closes the message producer.
 int getDeliveryMode()
          Gets the producer's default delivery mode.
 javax.jms.Destination getDestination()
          Gets the destination associated with this MessageProducer.
 boolean getDisableMessageID()
          API method.
 boolean getDisableMessageTimestamp()
          API method.
 int getPriority()
          Gets the producer's default priority.
 long getTimeToLive()
          Gets the default duration in milliseconds that a produced message should be retained by the provider.
 void send(javax.jms.Destination dest, javax.jms.Message message)
          Sends a message with default delivery parameters for an unidentified message producer.
 void send(javax.jms.Destination dest, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Sends a message with given delivery parameters for an unidentified message producer.
 void send(javax.jms.Message message)
          Sends a message with the default delivery parameters.
 void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Sends a message with given delivery parameters.
 void setDeliveryMode(int deliveryMode)
          Sets the producer's default delivery mode.
 void setDisableMessageID(boolean value)
          API method; not taken into account.
 void setDisableMessageTimestamp(boolean value)
          API method.
 void setPriority(int priority)
          Sets the producer's default priority.
 void setTimeToLive(long timeToLive)
          Sets the default duration of time in milliseconds that a produced message should be retained by the provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closed

protected boolean closed
true if the producer is closed.


sess

protected Session sess
The session the producer belongs to.


dest

protected Destination dest
The destination the producer sends messages to.

Method Detail

setDisableMessageID

public void setDisableMessageID(boolean value)
                         throws javax.jms.JMSException
API method; not taken into account.

Specified by:
setDisableMessageID in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

setDeliveryMode

public void setDeliveryMode(int deliveryMode)
                     throws javax.jms.JMSException
Sets the producer's default delivery mode. API method.

Specified by:
setDeliveryMode in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException - When setting an invalid delivery mode.

setPriority

public void setPriority(int priority)
                 throws javax.jms.JMSException
Sets the producer's default priority. API method.

Specified by:
setPriority in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException - When setting an invalid priority.

setTimeToLive

public void setTimeToLive(long timeToLive)
                   throws javax.jms.JMSException
Sets the default duration of time in milliseconds that a produced message should be retained by the provider. API method.

Specified by:
setTimeToLive in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

setDisableMessageTimestamp

public void setDisableMessageTimestamp(boolean value)
                                throws javax.jms.JMSException
API method.

Specified by:
setDisableMessageTimestamp in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getDestination

public javax.jms.Destination getDestination()
                                     throws javax.jms.JMSException
Gets the destination associated with this MessageProducer. API method.

Specified by:
getDestination in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getDisableMessageID

public boolean getDisableMessageID()
                            throws javax.jms.JMSException
API method.

Specified by:
getDisableMessageID in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getDeliveryMode

public int getDeliveryMode()
                    throws javax.jms.JMSException
Gets the producer's default delivery mode. API method.

Specified by:
getDeliveryMode in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getPriority

public int getPriority()
                throws javax.jms.JMSException
Gets the producer's default priority. API method.

Specified by:
getPriority in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getTimeToLive

public long getTimeToLive()
                   throws javax.jms.JMSException
Gets the default duration in milliseconds that a produced message should be retained by the provider. API method.

Specified by:
getTimeToLive in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

getDisableMessageTimestamp

public boolean getDisableMessageTimestamp()
                                   throws javax.jms.JMSException
API method.

Specified by:
getDisableMessageTimestamp in interface javax.jms.MessageProducer
Throws:
javax.jms.IllegalStateException - If the producer is closed.
javax.jms.JMSException

send

public void send(javax.jms.Message message)
          throws javax.jms.JMSException
Sends a message with the default delivery parameters.

Specified by:
send in interface javax.jms.MessageProducer
Throws:
java.lang.UnsupportedOperationException - If the dest is unidentified.
javax.jms.IllegalStateException - If the producer is closed, or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

send

public void send(javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws javax.jms.JMSException
Sends a message with given delivery parameters.

Specified by:
send in interface javax.jms.MessageProducer
Throws:
java.lang.UnsupportedOperationException - If the dest is unidentified.
javax.jms.IllegalStateException - If the producer is closed, or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

send

public void send(javax.jms.Destination dest,
                 javax.jms.Message message)
          throws javax.jms.JMSException
Sends a message with default delivery parameters for an unidentified message producer.

Specified by:
send in interface javax.jms.MessageProducer
Throws:
java.lang.UnsupportedOperationException - When the producer did not properly identify itself.
JMSSecurityException - If the user if not a WRITER on the specified destination.
javax.jms.IllegalStateException - If the producer is closed, or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

send

public void send(javax.jms.Destination dest,
                 javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws javax.jms.JMSException
Sends a message with given delivery parameters for an unidentified message producer.

Specified by:
send in interface javax.jms.MessageProducer
Throws:
java.lang.UnsupportedOperationException - When the producer did not properly identify itself.
JMSSecurityException - If the user if not a WRITER on the specified destination.
javax.jms.IllegalStateException - If the producer is closed, or if the connection is broken.
javax.jms.JMSException - If the request fails for any other reason.

close

public void close()
           throws javax.jms.JMSException
Closes the message producer. API method.

Specified by:
close in interface javax.jms.MessageProducer
Throws:
javax.jms.JMSException - Actually never thrown.

Joram 5.2.5

Copyright © 2000 - 2009 Scalagent D.T. - All rights reserved