public class GSMessageProducerImpl extends Object implements javax.jms.MessageProducer, javax.jms.QueueSender, javax.jms.TopicPublisher
javax.jms.MessageProducer
interface.
A client uses a MessageProducer
object to send messages to a destination. A
MessageProducer
object is created by passing a Destination
object to a
message-producer creation method supplied by a m_session.
MessageProducer
is the parent interface for all message producers.
A client also has the option of creating a message producer without supplying a destination.
In this case, a destination must be provided with every send operation. A typical use for this
kind of message producer is to send replies to requests using the request's
JMSReplyTo
destination.
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 an individual message.
A client can specify a time-to-live value in milliseconds for each message it sends. This value defines a message expiration time that is the sum of the message's time-to-live and the GMT when it is sent (for transacted sends, this is the time the client sends the message, not the time the transaction is committed).
TopicPublisher
,
QueueSender
,
Session.createProducer(javax.jms.Destination)
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_closed |
protected javax.jms.Destination |
m_dest
The destination the producer belongs to
|
protected GSSessionImpl |
m_session
The session the producer belongs to
|
Constructor and Description |
---|
GSMessageProducerImpl(GSSessionImpl sess,
javax.jms.Destination m_dest,
IMessageConverter messageConverter) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cancels the AckDataEntry notify delegator, using its Lease.cancel() Also it removes the
current producer from the producers list held by the m_session.
|
int |
getDeliveryMode() |
javax.jms.Destination |
getDestination() |
boolean |
getDisableMessageID() |
boolean |
getDisableMessageTimestamp() |
int |
getPriority() |
String |
getProducerID() |
javax.jms.Queue |
getQueue() |
protected GSSessionImpl |
getSession()
Returns the m_session that created this producer.
|
long |
getTimeToLive() |
javax.jms.Topic |
getTopic() |
void |
publish(javax.jms.Message message) |
void |
publish(javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive) |
void |
publish(javax.jms.Topic topic,
javax.jms.Message message) |
void |
publish(javax.jms.Topic topic,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive) |
void |
send(javax.jms.Destination destination,
javax.jms.Message message) |
void |
send(javax.jms.Destination _destination,
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) |
void |
send(javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive) |
void |
send(javax.jms.Queue queue,
javax.jms.Message message) |
void |
send(javax.jms.Queue queue,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive) |
void |
setDeliveryMode(int deliveryMode)
Sets the messages DeliveryMode for all the messages which will be sent via this producer in
the m_session level.
|
void |
setDisableMessageID(boolean value) |
void |
setDisableMessageTimestamp(boolean value) |
void |
setPriority(int priority)
Sets the priority for all the messages which be sent via this producer in the m_session
level.
|
void |
setProducerID(String m_producerID) |
void |
setTimeToLive(long timeToLive)
Sets the default length of time in milliseconds from its dispatch time that a produced
message should be retained by the message system.
|
String |
toString() |
protected GSSessionImpl m_session
protected javax.jms.Destination m_dest
protected volatile boolean m_closed
public GSMessageProducerImpl(GSSessionImpl sess, javax.jms.Destination m_dest, IMessageConverter messageConverter) throws javax.jms.JMSException
sess
- - The Session the producer belongs tom_dest
- - The destination (Queue or Topic) that the producer sends messages tojavax.jms.JMSException
public void setDisableMessageID(boolean value) throws javax.jms.JMSException
setDisableMessageID
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.setDisableMessageID(boolean)
public boolean getDisableMessageID() throws javax.jms.JMSException
getDisableMessageID
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getDisableMessageID()
public void setDisableMessageTimestamp(boolean value) throws javax.jms.JMSException
setDisableMessageTimestamp
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.setDisableMessageTimestamp(boolean)
public void setProducerID(String m_producerID)
public boolean getDisableMessageTimestamp() throws javax.jms.JMSException
getDisableMessageTimestamp
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getDisableMessageTimestamp()
public void setDeliveryMode(int deliveryMode) throws javax.jms.JMSException
setDeliveryMode
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.setDeliveryMode(int)
public int getDeliveryMode() throws javax.jms.JMSException
getDeliveryMode
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getDeliveryMode()
public void setPriority(int priority) throws javax.jms.JMSException
setPriority
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.setPriority(int)
public int getPriority() throws javax.jms.JMSException
getPriority
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getPriority()
public void setTimeToLive(long timeToLive) throws javax.jms.JMSException
Time to live is set to zero by default.
setTimeToLive
in interface javax.jms.MessageProducer
timeToLive
- the message time to live in milliseconds; zero is unlimited, while then it
is calculated according to the space ttl Lease.Forever which is
Long.max_valuejavax.jms.JMSException
- if the JMS provider fails to set the time to live due to some internal
error.MessageProducer.getTimeToLive()
,
Message.DEFAULT_TIME_TO_LIVE
public long getTimeToLive() throws javax.jms.JMSException
getTimeToLive
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getTimeToLive()
public javax.jms.Destination getDestination() throws javax.jms.JMSException
getDestination
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.getDestination()
public void close() throws javax.jms.JMSException
close
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.close()
public void send(javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
send
in interface javax.jms.QueueSender
javax.jms.JMSException
MessageProducer.send(Message)
public void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
send
in interface javax.jms.QueueSender
javax.jms.JMSException
MessageProducer.send(Message, int, int, long)
public void send(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
javax.jms.JMSException
MessageProducer.send(Destination, Message)
public void send(javax.jms.Destination _destination, javax.jms.Message _message, int _deliveryMode, int _priority, long _timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
UnsupportedOperationException
- When the producer did not properly identify itself.javax.jms.JMSSecurityException
- If the user if not a WRITER on the specified
destination.javax.jms.IllegalStateException
- If the producer is m_closed, or if the connection is
broken.javax.jms.JMSException
- If the request fails for any other reason.MessageProducer.send(Destination, Message, int, int, long)
public String getProducerID()
protected GSSessionImpl getSession()
public javax.jms.Queue getQueue() throws javax.jms.JMSException
getQueue
in interface javax.jms.QueueSender
javax.jms.JMSException
QueueSender.getQueue()
public void send(javax.jms.Queue queue, javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.QueueSender
javax.jms.JMSException
QueueSender.send(Queue, Message)
public void send(javax.jms.Queue queue, javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.QueueSender
javax.jms.JMSException
QueueSender.send(Queue, Message, int, int, long)
public javax.jms.Topic getTopic() throws javax.jms.JMSException
getTopic
in interface javax.jms.TopicPublisher
javax.jms.JMSException
TopicPublisher.getTopic()
public void publish(javax.jms.Message message) throws javax.jms.JMSException
publish
in interface javax.jms.TopicPublisher
javax.jms.JMSException
MessageProducer.send(Message)
public void publish(javax.jms.Topic topic, javax.jms.Message message) throws javax.jms.JMSException
publish
in interface javax.jms.TopicPublisher
javax.jms.JMSException
MessageProducer.send(Destination, Message)
public void publish(javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
publish
in interface javax.jms.TopicPublisher
javax.jms.JMSException
MessageProducer.send(Message, int, int, long)
public void publish(javax.jms.Topic topic, javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
publish
in interface javax.jms.TopicPublisher
javax.jms.JMSException
MessageProducer.send(Destination, Message, int, int, long)
Copyright © GigaSpaces.