public class MessageProducerImpl extends java.lang.Object implements MessageProducer
| Modifier and Type | Field and Description |
|---|---|
protected AbstractDestination |
_queue |
protected JmsSession |
_session |
static long |
DEFAULT_TIME_TO_LIVE |
| Constructor and Description |
|---|
MessageProducerImpl(JmsSession session,
AbstractDestination queue) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
calculateExpiration(long timeToLive)
Calculates the expires time.
|
void |
close()
Closes the producer.
|
int |
getDeliveryMode()
Returns the default delivery mode.
|
Destination |
getDestination()
Returns the producer's destination.
|
boolean |
getDisableMessageID()
Returns true if message ids are disabled by default.
|
boolean |
getDisableMessageTimestamp()
Returns true if message timestamps are disabled by default.
|
int |
getPriority()
Returns the default priority
|
long |
getTimeToLive()
Returns the default time to live
|
void |
send(Destination destination,
Message message)
Sends a message to the destination
|
void |
send(Destination destination,
Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to the destination
|
void |
send(Message message)
Sends a message to the destination
|
void |
send(Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to the destination
|
void |
setDeliveryMode(int deliveryMode)
Sets the default delivery mode.
|
void |
setDisableMessageID(boolean disable)
Sets true if message ids should be disabled by default.
|
void |
setDisableMessageTimestamp(boolean disable)
Sets true if message timestamps should be disabled by default.
|
void |
setPriority(int priority)
Sets the default priority.
|
void |
setTimeToLive(long timeToLive)
Sets the default time to live.
|
java.lang.String |
toString() |
public static final long DEFAULT_TIME_TO_LIVE
protected JmsSession _session
protected AbstractDestination _queue
public MessageProducerImpl(JmsSession session, AbstractDestination queue)
public Destination getDestination() throws JMSException
getDestination in interface MessageProducerJMSExceptionpublic int getDeliveryMode()
throws JMSException
getDeliveryMode in interface MessageProducerJMSExceptionpublic void setDeliveryMode(int deliveryMode)
throws JMSException
setDeliveryMode in interface MessageProducerJMSExceptionpublic boolean getDisableMessageID()
throws JMSException
getDisableMessageID in interface MessageProducerJMSExceptionpublic void setDisableMessageID(boolean disable)
throws JMSException
setDisableMessageID in interface MessageProducerJMSExceptionpublic boolean getDisableMessageTimestamp()
throws JMSException
getDisableMessageTimestamp in interface MessageProducerJMSExceptionpublic void setDisableMessageTimestamp(boolean disable)
throws JMSException
setDisableMessageTimestamp in interface MessageProducerJMSExceptionpublic int getPriority()
throws JMSException
getPriority in interface MessageProducerJMSExceptionpublic void setPriority(int priority)
throws JMSException
setPriority in interface MessageProducerJMSExceptionpublic long getTimeToLive()
throws JMSException
getTimeToLive in interface MessageProducerJMSExceptionpublic void setTimeToLive(long timeToLive)
throws JMSException
setTimeToLive in interface MessageProducerJMSExceptionpublic void send(Message message) throws JMSException
send in interface MessageProducermessage - the message to sendJMSExceptionpublic void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
send in interface MessageProducermessage - the message to senddeliveryMode - the delivery modepriority - the prioritytimeToLive - how long the message should liveJMSExceptionpublic void send(Destination destination, Message message) throws JMSException
send in interface MessageProducerdestination - the destination the message should be send tomessage - the message to sendJMSExceptionpublic void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
send in interface MessageProducerdestination - the destination the message should be send tomessage - the message to senddeliveryMode - the delivery modepriority - the prioritytimeToLive - how long the message should liveJMSExceptionprotected long calculateExpiration(long timeToLive)
public void close()
throws JMSException
close in interface MessageProducerJMSExceptionpublic java.lang.String toString()
toString in class java.lang.Object