Methods Summary |
---|
public void | close()Closes the message producer.
Since a provider may allocate some resources on behalf of a
MessageProducer outside the Java virtual machine, clients
should close them when they
are not needed. Relying on garbage collection to eventually reclaim
these resources may not be timely enough.
|
public int | getDeliveryMode()Gets the producer's default delivery mode.
|
public Destination | getDestination()Gets the destination associated with this MessageProducer .
|
public boolean | getDisableMessageID()Gets an indication of whether message IDs are disabled.
|
public boolean | getDisableMessageTimestamp()Gets an indication of whether message timestamps are disabled.
|
public int | getPriority()Gets the producer's default priority.
|
public long | getTimeToLive()Gets the default length of time in milliseconds from its dispatch time
that a produced message should be retained by the message system.
|
public void | send(Message message)Sends a message using the MessageProducer 's
default delivery mode, priority, and time to live.
|
public void | send(Message message, int deliveryMode, int priority, long timeToLive)Sends a message to the destination, specifying delivery mode, priority, and
time to live.
|
public void | send(Destination destination, Message message)Sends a message to a destination for an unidentified message producer.
Uses the MessageProducer 's default delivery mode, priority,
and time to live.
Typically, a message producer is assigned a destination at creation
time; however, the JMS API also supports unidentified message producers,
which require that the destination be supplied every time a message is
sent.
|
public void | send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)Sends a message to a destination for an unidentified message producer,
specifying delivery mode, priority and time to live.
Typically, a message producer is assigned a destination at creation
time; however, the JMS API also supports unidentified message producers,
which require that the destination be supplied every time a message is
sent.
|
public void | setDeliveryMode(int deliveryMode)Sets the producer's default delivery mode.
Delivery mode is set to PERSISTENT by default.
|
public void | setDisableMessageID(boolean value)Sets whether message IDs are disabled.
Since message IDs take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the message ID is not used by
an application. By calling the setDisableMessageID
method on this message producer, a JMS client enables this potential
optimization for all messages sent by this message producer. If the JMS
provider accepts this hint,
these messages must have the message ID set to null; if the provider
ignores the hint, the message ID must be set to its normal unique value.
Message IDs are enabled by default.
|
public void | setDisableMessageTimestamp(boolean value)Sets whether message timestamps are disabled.
Since timestamps take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the timestamp is not used by an
application. By calling the setDisableMessageTimestamp
method on this message producer, a JMS client enables this potential
optimization for all messages sent by this message producer. If the
JMS provider accepts this hint,
these messages must have the timestamp set to zero; if the provider
ignores the hint, the timestamp must be set to its normal value.
Message timestamps are enabled by default.
|
public void | setPriority(int defaultPriority)Sets the producer's default priority.
The JMS API defines ten levels of priority value, with 0 as the
lowest priority and 9 as the highest. Clients should consider priorities
0-4 as gradations of normal priority and priorities 5-9 as gradations
of expedited priority. Priority is set to 4 by default.
|
public 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.
Time to live is set to zero by default.
|