Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

javax::jms::MessageProducer Class Reference

A client uses a MessageProducer object to send messages to a destination. More...

#include <javax_jms_MessageProducer.h>

Inheritance diagram for javax::jms::MessageProducer:

Inheritance graph
[legend]
Collaboration diagram for javax::jms::MessageProducer:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  xmogDefaultFlags = xmog_base::GLOBAL, xmogMajorVersion = 3, xmogMinorVersion = 2, xmogPatchVersion = 9,
  xmogBuildNumber = 2047
}
typedef ::xmog_java_array_template<
::javax::jms::MessageProducer
array1D
typedef ::xmog_java_array_template<
::xmog_java_array_template<
::javax::jms::MessageProducer > > 
array2D

Public Member Functions

virtual void close (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Closes the message producer.
virtual jint getDeliveryMode (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets the producer's default delivery mode.
virtual ::javax::jms::Destination getDestination (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets the destination associated with this MessageProducer.
virtual bool getDisableMessageID (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets an indication of whether message IDs are disabled.
virtual bool getDisableMessageTimestamp (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets an indication of whether message timestamps are disabled.
virtual jint getPriority (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets the producer's default priority.
virtual jlong getTimeToLive (::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
virtual void send (const ::javax::jms::Destination &destination, const ::javax::jms::Message &message, jint deliveryMode, jint priority, jlong timeToLive,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.
virtual void send (const ::javax::jms::Message &message, jint deliveryMode, jint priority, jlong timeToLive,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sends a message to the destination, specifying delivery mode, priority, and time to live.
virtual void send (const ::javax::jms::Destination &destination, const ::javax::jms::Message &message,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sends a message to a destination for an unidentified message producer.
virtual void send (const ::javax::jms::Message &message,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sends a message using the MessageProducer's default delivery mode, priority, and time to live.
virtual void setDeliveryMode (jint deliveryMode,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets the producer's default delivery mode.
virtual void setDisableMessageID (bool value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets whether message IDs are disabled.
virtual void setDisableMessageTimestamp (bool value,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets whether message timestamps are disabled.
virtual void setPriority (jint defaultPriority,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets the producer's default priority.
virtual void setTimeToLive (jlong timeToLive,::xmog_localenv *p_xenv=NULL, xmog_flags f_xflags=xmogDefaultFlags)
 Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Detailed Description

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 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).

A JMS provider should do its best to expire messages accurately; however, the JMS API does not define the accuracy provided.

Author:
Mark Hapner

Rich Burridge

Kate Stout


Member Function Documentation

virtual void javax::jms::MessageProducer::close ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual jint javax::jms::MessageProducer::getDeliveryMode ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Gets the producer's default delivery mode.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the message delivery mode for this message producer

virtual ::javax::jms::Destination javax::jms::MessageProducer::getDestination ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
 

Gets the destination associated with this MessageProducer.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
this producer's Destination/

virtual bool javax::jms::MessageProducer::getDisableMessageID ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Gets an indication of whether message IDs are disabled.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
an indication of whether message IDs are disabled

virtual bool javax::jms::MessageProducer::getDisableMessageTimestamp ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Gets an indication of whether message timestamps are disabled.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
an indication of whether message timestamps are disabled

virtual jint javax::jms::MessageProducer::getPriority ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Gets the producer's default priority.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the message priority for this message producer

virtual jlong javax::jms::MessageProducer::getTimeToLive ::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.

Parameters:
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:
the message time to live in milliseconds; zero is unlimited

virtual void javax::jms::MessageProducer::send const ::javax::jms::Destination destination,
const ::javax::jms::Message message,
jint  deliveryMode,
jint  priority,
jlong  timeToLive,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
destination the destination to send this message to
message the message to send
deliveryMode the delivery mode to use
priority the priority for this message
timeToLive the message's lifetime (in milliseconds)
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::send const ::javax::jms::Message message,
jint  deliveryMode,
jint  priority,
jlong  timeToLive,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sends a message to the destination, specifying delivery mode, priority, and time to live.

Parameters:
message the message to send
deliveryMode the delivery mode to use
priority the priority for this message
timeToLive the message's lifetime (in milliseconds)
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented in javax::jms::QueueSender.

virtual void javax::jms::MessageProducer::send const ::javax::jms::Destination destination,
const ::javax::jms::Message message,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
destination the destination to send this message to
message the message to send
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::send const ::javax::jms::Message message,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sends a message using the MessageProducer's default delivery mode, priority, and time to live.

Parameters:
message the message to send
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

Reimplemented in javax::jms::QueueSender.

virtual void javax::jms::MessageProducer::setDeliveryMode jint  deliveryMode,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

Sets the producer's default delivery mode.

Delivery mode is set to PERSISTENT by default.

Parameters:
deliveryMode the message delivery mode for this message producer; legal values are DeliveryMode.NON_PERSISTENT and DeliveryMode.PERSISTENT
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::setDisableMessageID bool  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
value indicates if message IDs are disabled
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::setDisableMessageTimestamp bool  value,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
value indicates if message timestamps are disabled
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::setPriority jint  defaultPriority,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
defaultPriority the message priority for this message producer; must be a value between 0 and 9
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:

virtual void javax::jms::MessageProducer::setTimeToLive jlong  timeToLive,
::xmog_localenv p_xenv = NULL,
xmog_flags  f_xflags = xmogDefaultFlags
[virtual]
 

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.

Parameters:
timeToLive the message time to live in milliseconds; zero is unlimited
p_xenv the local call environment. The default value is NULL.
f_xflags the flags that allow control over the reference type and other internal matters. The default value is xmog_base::GLOBAL.
Returns:


The documentation for this class was generated from the following file:
Generated on Fri Jun 16 10:19:55 2006 for JMS Courier for C++ by  doxygen 1.4.1