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 MessageProducer
JMSException
public int getDeliveryMode() throws JMSException
getDeliveryMode
in interface MessageProducer
JMSException
public void setDeliveryMode(int deliveryMode) throws JMSException
setDeliveryMode
in interface MessageProducer
JMSException
public boolean getDisableMessageID() throws JMSException
getDisableMessageID
in interface MessageProducer
JMSException
public void setDisableMessageID(boolean disable) throws JMSException
setDisableMessageID
in interface MessageProducer
JMSException
public boolean getDisableMessageTimestamp() throws JMSException
getDisableMessageTimestamp
in interface MessageProducer
JMSException
public void setDisableMessageTimestamp(boolean disable) throws JMSException
setDisableMessageTimestamp
in interface MessageProducer
JMSException
public int getPriority() throws JMSException
getPriority
in interface MessageProducer
JMSException
public void setPriority(int priority) throws JMSException
setPriority
in interface MessageProducer
JMSException
public long getTimeToLive() throws JMSException
getTimeToLive
in interface MessageProducer
JMSException
public void setTimeToLive(long timeToLive) throws JMSException
setTimeToLive
in interface MessageProducer
JMSException
public void send(Message message) throws JMSException
send
in interface MessageProducer
message
- the message to sendJMSException
public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
send
in interface MessageProducer
message
- the message to senddeliveryMode
- the delivery modepriority
- the prioritytimeToLive
- how long the message should liveJMSException
public void send(Destination destination, Message message) throws JMSException
send
in interface MessageProducer
destination
- the destination the message should be send tomessage
- the message to sendJMSException
public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
send
in interface MessageProducer
destination
- the destination the message should be send tomessage
- the message to senddeliveryMode
- the delivery modepriority
- the prioritytimeToLive
- how long the message should liveJMSException
protected long calculateExpiration(long timeToLive)
public void close() throws JMSException
close
in interface MessageProducer
JMSException
public java.lang.String toString()
toString
in class java.lang.Object