|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mq.jms.MQMessageProducer
A client uses an MQMessageProducer to send messages to a destination.
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 the message producer. |
boolean |
getDisableMessageID()
Indicates whether message IDs are disabled. |
boolean |
getDisableMessageTimestamp()
Indicates whether message timestamps are disabled. |
int |
getPriority()
Gets the producer's default priority. |
long |
getTimeToLive()
Gets the default length of time that a produced message will be retained by the message system. |
void |
send(javax.jms.Destination destination,
javax.jms.Message message)
Sends a message to a destination if you are using a message producer for which no destination was specified when the message producer was created. |
void |
send(javax.jms.Destination destination,
javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message to a destination if you are using a message producer for which no destination was specified when the message producer was created. |
void |
send(javax.jms.Message message)
Sends a message. |
void |
send(javax.jms.Message message,
int deliveryMode,
int priority,
long timeToLive)
Sends a message specifying a delivery mode, a priority, and the lifetime of the message. |
void |
setDeliveryMode(int deliveryMode)
Sets the producer's default delivery mode. |
void |
setDisableMessageID(boolean value)
Sets whether message IDs are disabled. |
void |
setDisableMessageTimestamp(boolean value)
Sets whether message timestamps are disabled. |
void |
setPriority(int priority)
Sets the producer's default priority. |
void |
setTimeToLive(long timeToLive)
Sets the default length of time that the message system retains a produced message. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void close() throws javax.jms.JMSException
close
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_EXCEPTION_MQ_Q_CLOSE_FAILED
public void setDisableMessageID(boolean value) throws javax.jms.JMSException
Service implementation.
setDisableMessageID
in interface javax.jms.MessageProducer
value
- true if message IDs are disabled.
Message IDs are enabled by default.
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
public boolean getDisableMessageID() throws javax.jms.JMSException
getDisableMessageID
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
public void setDisableMessageTimestamp(boolean value) throws javax.jms.JMSException
setDisableMessageTimestamp
in interface javax.jms.MessageProducer
value
- true indicates that timestamps are disabled.
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
public boolean getDisableMessageTimestamp() throws javax.jms.JMSException
getDisableMessageTimestamp
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
public void setDeliveryMode(int deliveryMode) throws javax.jms.JMSException
setDeliveryMode
in interface javax.jms.MessageProducer
deliveryMode
- the message delivery mode for this message producer.
Possible values are:
DeliveryMode.NON_PERSISTENT
DeliveryMode.PERSISTENT
, the default
javax.jms.JMSException
- with one of the following reasons:
getDeliveryMode()
,
Message.DEFAULT_DELIVERY_MODE
public int getDeliveryMode() throws javax.jms.JMSException
getDeliveryMode
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
setDeliveryMode(int)
public void setPriority(int priority) throws javax.jms.JMSException
setPriority
in interface javax.jms.MessageProducer
priority
- the message priority for this message producer.
Values can be between 0 and 9, inclusive.
The default is 4.
javax.jms.JMSException
- with one of the following reasons:
getPriority()
,
Message.DEFAULT_PRIORITY
public int getPriority() throws javax.jms.JMSException
getPriority
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
setPriority(int)
public void setTimeToLive(long timeToLive) throws javax.jms.JMSException
Note that this method throws a JMSException if set to other than 0 when you make a direct connection to a broker.
setTimeToLive
in interface javax.jms.MessageProducer
timeToLive
- the length of time from its dispatch that a message is retained by default (milliseconds).
The default is zero which means unlimited time.
javax.jms.JMSException
- with one of the following reasons:
getTimeToLive()
,
Message.DEFAULT_TIME_TO_LIVE
public long getTimeToLive() throws javax.jms.JMSException
getTimeToLive
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reason
MQJMS_MESSAGEPRODUCER_CLOSED
setTimeToLive(long)
public void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
message
- the message to send.deliveryMode
- the delivery mode to use.priority
- the priority for the messagetimeToLive
- the lifetime of the message in milliseconds.
javax.jms.JMSException
- with one of the following reasons:
MQJMS_PS_TOPIC_NULL
MQJMS_E_TMPT_DELETED
MQJMS_EXCEPTION_BAD_VALUE
MQJMS_PUBLISHER_CLOSED
MQJMS_E_UNIDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_NULL_Q
MQJMS_E_SESSION_ASYNC
MQJMS_PS_PUBLISH_MSG_FAILED
MQJMS_ERR_QSENDER_CLOSED
MQJMS_E_SESSION_CLOSED
MQJMS_E_UNKNOWN_TARGET_CLIENT
MQJMS_PS_PUBLISH_MSG_BUILD
MQJMS_EXCEPTION_MSG_CREATE_ERROR
MQJMS_UTIL_PS_NO_BROKER
MQJMS_E_11_SERVICES_NOT_SETUP
MQJMS_E_INTERNAL_ERROR
MQJMS_EXCEPTION_PUT_MSG_FAILED
MQSession.createProducer(javax.jms.Destination)
public void send(javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
message
- the message to be sent.
javax.jms.JMSException
- with one of the following reasons:
MQJMS_PS_TOPIC_NULL
MQJMS_E_TMPT_DELETED
MQJMS_EXCEPTION_BAD_VALUE
MQJMS_PUBLISHER_CLOSED
MQJMS_E_UNIDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_NULL_Q
MQJMS_E_SESSION_ASYNC
MQJMS_PS_PUBLISH_MSG_FAILED
MQJMS_ERR_QSENDER_CLOSED
MQJMS_E_SESSION_CLOSED
MQJMS_E_UNKNOWN_TARGET_CLIENT
MQJMS_PS_PUBLISH_MSG_BUILD
MQJMS_EXCEPTION_MSG_CREATE_ERROR
MQJMS_UTIL_PS_NO_BROKER
MQJMS_E_11_SERVICES_NOT_SETUP
MQJMS_E_INTERNAL_ERROR
MQJMS_EXCEPTION_PUT_MSG_FAILED
MQJMS_MESSAGEPRODUCER_CLOSED
java.lang.UnsupportedOperationException
- if a client uses this method with a
message producer for which no destination was specified when it was created.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
destination
- the destination to which to send the message.message
- the message to send.deliveryMode
- the delivery mode to usepriority
- the priority for the messagetimeToLive
- the lifetime of the message in milliseconds
javax.jms.JMSException
- with one of the following reasons:
MQJMS_PUBLISHER_CLOSED
MQJMS_E_IDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_NULL_Q
MQJMS_EXCEPTION_MQ_Q_OPEN_FAILED
MQJMS_E_SESSION_ASYNC
MQJMS_PS_PUBLISH_MSG_FAILED
MQJMS_EXCEPTION_INVALID_DESTINATION
MQJMS_EXCEPTION_BAD_VALUE
MQJMS_E_UNKNOWN_TARGET_CLIENT
MQJMS_PS_PUBLISH_MSG_BUILD
MQJMS_EXCEPTION_MSG_CREATE_ERROR
MQJMS_ERR_QSENDER_CLOSED
MQJMS_E_SESSION_CLOSED
MQJMS_E_UNIDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_Q_CLOSE_FAILED
MQRC_Q_TYPE_ERROR
MQJMS_EXCEPTION_BAD_VALUE
MQJMS_E_INTERNAL_ERROR
MQJMS_EXCEPTION_PUT_MSG_FAILED
MQSession.createProducer(javax.jms.Destination)
public void send(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
send
in interface javax.jms.MessageProducer
destination
- the message destination.message
- the message to send.
javax.jms.JMSException
- with one of the following reasons:
MQJMS_PUBLISHER_CLOSED
MQJMS_E_IDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_NULL_Q
MQJMS_EXCEPTION_MQ_Q_OPEN_FAILED
MQJMS_E_SESSION_ASYNC
MQJMS_PS_PUBLISH_MSG_FAILED
MQJMS_EXCEPTION_INVALID_DESTINATION
MQJMS_EXCEPTION_BAD_VALUE
MQJMS_E_UNKNOWN_TARGET_CLIENT
MQJMS_PS_PUBLISH_MSG_BUILD
MQJMS_EXCEPTION_MSG_CREATE_ERROR
MQJMS_ERR_QSENDER_CLOSED
MQJMS_E_SESSION_CLOSED
MQJMS_E_UNIDENT_PRO_INVALID_OP
MQJMS_EXCEPTION_MQ_Q_CLOSE_FAILED
MQRC_Q_TYPE_ERROR
MQJMS_E_INTERNAL_ERROR
MQJMS_EXCEPTION_PUT_MSG_FAILED
MQJMS_MESSAGEPRODUCER_CLOSED
MQSession.createProducer(javax.jms.Destination)
public javax.jms.Destination getDestination() throws javax.jms.JMSException
getDestination
in interface javax.jms.MessageProducer
javax.jms.JMSException
- with reasons MQJMS_E_INTERNAL_ERROR
|
(c) Copyright IBM Corp. 2005. All Rights Reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |