|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.client.jms.MessageProducer
public class 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. |
private int |
deliveryMode
Default delivery mode. |
protected Destination |
dest
The destination the producer sends messages to. |
private boolean |
identified
true if the producer's destination is identified. |
private static org.objectweb.util.monolog.api.Logger |
logger
|
private boolean |
messageIDDisabled
true if the client requests not to use the message
identifiers; however it is not taken into account, as our MOM needs
message identifiers for managing acknowledgements. |
private int |
priority
Default priority. |
protected Session |
sess
The session the producer belongs to. |
private boolean |
timestampDisabled
true if the time stamp is disabled. |
private long |
timeToLive
Default time to live. |
Constructor Summary | |
---|---|
MessageProducer(Session sess,
Destination dest)
Constructs a producer. |
Method Summary | |
---|---|
void |
close()
Closes the message producer. |
private void |
doSend(Destination dest,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Actually sends a message to a given destination. |
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 |
---|
private int deliveryMode
private int priority
private long timeToLive
private boolean messageIDDisabled
true
if the client requests not to use the message
identifiers; however it is not taken into account, as our MOM needs
message identifiers for managing acknowledgements.
private boolean timestampDisabled
true
if the time stamp is disabled.
private boolean identified
true
if the producer's destination is identified.
protected boolean closed
true
if the producer is closed.
protected Session sess
protected Destination dest
private static org.objectweb.util.monolog.api.Logger logger
Constructor Detail |
---|
MessageProducer(Session sess, Destination dest) throws javax.jms.JMSException
sess
- The session the producer belongs to.dest
- The destination the producer sends messages to.
javax.jms.InvalidDestinationException
- if an invalid destination is specified.
javax.jms.IllegalStateException
- If the connection is broken.
javax.jms.JMSException
- If the creation fails for any other reason.Method Detail |
---|
public void setDisableMessageID(boolean value) throws javax.jms.JMSException
setDisableMessageID
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public void setDeliveryMode(int deliveryMode) throws javax.jms.JMSException
setDeliveryMode
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
- When setting an invalid delivery mode.public void setPriority(int priority) throws javax.jms.JMSException
setPriority
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
- When setting an invalid priority.public void setTimeToLive(long timeToLive) throws javax.jms.JMSException
setTimeToLive
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public void setDisableMessageTimestamp(boolean value) throws javax.jms.JMSException
setDisableMessageTimestamp
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public javax.jms.Destination getDestination() throws javax.jms.JMSException
getDestination
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public boolean getDisableMessageID() throws javax.jms.JMSException
getDisableMessageID
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public int getDeliveryMode() throws javax.jms.JMSException
getDeliveryMode
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public int getPriority() throws javax.jms.JMSException
getPriority
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public long getTimeToLive() throws javax.jms.JMSException
getTimeToLive
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public boolean getDisableMessageTimestamp() throws javax.jms.JMSException
getDisableMessageTimestamp
in interface javax.jms.MessageProducer
javax.jms.IllegalStateException
- If the producer is closed.
javax.jms.JMSException
public void send(javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
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.public void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
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.public void send(javax.jms.Destination dest, javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
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.public void send(javax.jms.Destination dest, javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
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.public void close() throws javax.jms.JMSException
close
in interface javax.jms.MessageProducer
javax.jms.JMSException
- Actually never thrown.private void doSend(Destination dest, javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
javax.jms.MessageFormatException
- If the message to send is invalid.
javax.jms.InvalidDestinationException
- If the specified destination is
invalid.
javax.jms.IllegalStateException
- If the connection is broken.
javax.jms.JMSException
- If the request fails for any other reason.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |