Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

oracle.jms
Class AQjmsProducer

java.lang.Object
  |
  +--oracle.jms.AQjmsObject
        |
        +--oracle.jms.AQjmsProducer
All Implemented Interfaces:
AQjmsQueueSender, AQjmsTopicPublisher, MessageProducer, QueueSender, TopicPublisher

public class AQjmsProducer
extends oracle.jms.AQjmsObject
implements AQjmsQueueSender, AQjmsTopicPublisher

Oracle class implementing oracle.jms.AQjmsQueueSender, oracle.jms.AQjmsTopicPublisher

See Also:
AQjmsQueueSender, AQjmsTopicPublisher

Method Summary
 void close()
          Closes the message producer.
 int getDeliveryMode()
          Get the producer's default delivery mode.
 javax.jms.Destination getDestination()
          Gets the destination associated with this MessageProducer.
 boolean getDisableMessageID()
          Get an indication of whether message IDs are disabled.
 boolean getDisableMessageTimestamp()
          Get an indication of whether message timestamps are disabled.
 int getPriority()
          Get the producer's default priority.
 javax.jms.Queue getQueue()
          Get the queue associated with this queue sender.
 long getTimeToLive()
          Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
 javax.jms.Topic getTopic()
          Get the topic associated with this publisher.
 java.lang.String getTransformation()
          Get the transformation for the consumer
 void publish(javax.jms.Message message)
          Publish a Message to the topic
 void publish(javax.jms.Message message, oracle.jms.AQjmsAgent[] recipient_list)
          Publish a Message to a specific list of recipients
 void publish(javax.jms.Message message, oracle.jms.AQjmsAgent[] recipient_list, int deliveryMode, int priority, long timeToLive)
          Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
 void publish(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Publish a Message to the topic specifying delivery mode, priority and time to live to the topic.
 void publish(javax.jms.Topic topic, javax.jms.Message message)
          Publish a Message to a topic for an unidentified message producer.
 void publish(javax.jms.Topic topic, javax.jms.Message message, oracle.jms.AQjmsAgent[] recipient_list)
          Publish a Message to a topic by specifying a list of recipients
 void publish(javax.jms.Topic topic, javax.jms.Message message, oracle.jms.AQjmsAgent[] recipient_list, int deliveryMode, int priority, long timeToLive)
          Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
 void publish(javax.jms.Topic topic, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Publish a Message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
 void send(javax.jms.Destination destination, javax.jms.Message message)
          Sends a message to a destination for an unidentified message producer.
 void send(javax.jms.Destination destination, javax.jms.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.
 void send(javax.jms.Message message)
          Send a message
 void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Send a message.
 void send(javax.jms.Queue queue, javax.jms.Message message)
          Send a message.
 void send(javax.jms.Queue queue, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Send a message.
 void setDeliveryMode(int deliveryMode)
          Set the producer's default delivery mode.
 void setDisableMessageID(boolean value)
          Set whether message IDs are disabled.
 void setDisableMessageTimestamp(boolean value)
          Set whether message timestamps are disabled.
 void setPriority(int priority)
          Set the producer's default priority.
 void setTimeToLive(long timeToLive)
          Set the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
 void setTransformation(java.lang.String transformation)
          Set the transformation for the consumer

 

Methods inherited from class oracle.jms.AQjmsObject
checkClosed, children, finalize, getID, getParent, isOpen, localClose, preClose

 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

setDisableMessageID

public void setDisableMessageID(boolean value)
                         throws JMSException
Set whether message IDs are disabled.

Since message ID's 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 message ID is not used by an application. JMS message Producers provide a hint to disable message ID. When a client sets a Producer to disable message ID they are saying that they do not depend on the value of message ID for the messages it produces. These messages must either have message ID set to null or, if the hint is ignored, messageID must be set to its normal unique value.

Message IDs are enabled by default.

Specified by:
setDisableMessageID in interface MessageProducer
Parameters:
value - indicates if message IDs are disabled.
Throws:
JMSException - if JMS fails to set disabled message Id due to some internal error.

getDisableMessageID

public boolean getDisableMessageID()
                            throws JMSException
Get an indication of whether message IDs are disabled.
Specified by:
getDisableMessageID in interface MessageProducer
Returns:
an indication of whether message IDs are disabled.
Throws:
JMSException - if JMS fails to get disabled message Id due to some internal error.

setDisableMessageTimestamp

public void setDisableMessageTimestamp(boolean value)
                                throws JMSException
Set whether message timestamps are disabled.
Specified by:
setDisableMessageTimestamp in interface MessageProducer
Parameters:
value - indicates if message timestamps are disabled.
Throws:
JMSException - if JMS fails to set disabled message timestamp due to some internal error.

getDisableMessageTimestamp

public boolean getDisableMessageTimestamp()
                                   throws JMSException
Get an indication of whether message timestamps are disabled.
Specified by:
getDisableMessageTimestamp in interface MessageProducer
Returns:
an indication of whether message IDs are disabled.
Throws:
JMSException - if JMS fails to get disabled message timestamp due to some internal error.

setDeliveryMode

public void setDeliveryMode(int deliveryMode)
                     throws JMSException
Set the producer's default delivery mode.

Delivery mode is set to PERSISTENT by default.

Specified by:
setDeliveryMode in interface MessageProducer
Parameters:
deliveryMode - the message delivery mode for this message producer.
Throws:
JMSException - if JMS fails to set delivery mode due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), DeliveryMode.NON_PERSISTENT, DeliveryMode.PERSISTENT, Message.DEFAULT_DELIVERY_MODE

getDeliveryMode

public int getDeliveryMode()
                    throws JMSException
Get the producer's default delivery mode.
Specified by:
getDeliveryMode in interface MessageProducer
Returns:
the message delivery mode for this message producer.
Throws:
JMSException - if JMS fails to get delivery mode due to some internal error.
See Also:
MessageProducer.setDeliveryMode(int)

setPriority

public void setPriority(int priority)
                 throws JMSException
Set the producer's default priority.

Priority is set to 4, by default.

Specified by:
setPriority in interface MessageProducer
Parameters:
priority - the message priority for this message producer.
Throws:
JMSException - if JMS fails to set priority due to some internal error.
See Also:
MessageProducer.getPriority(), Message.DEFAULT_PRIORITY

getPriority

public int getPriority()
                throws JMSException
Get the producer's default priority.
Specified by:
getPriority in interface MessageProducer
Returns:
the message priority for this message producer.
Throws:
JMSException - if JMS fails to get priority due to some internal error.
See Also:
MessageProducer.setPriority(int)

setTimeToLive

public void setTimeToLive(long timeToLive)
                   throws JMSException
Set 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.

Specified by:
setTimeToLive in interface MessageProducer
Parameters:
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to set Time to Live due to some internal error.
See Also:
MessageProducer.getTimeToLive(), Message.DEFAULT_TIME_TO_LIVE

getTimeToLive

public long getTimeToLive()
                   throws JMSException
Get the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system.
Specified by:
getTimeToLive in interface MessageProducer
Returns:
the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to get Time to Live due to some internal error.
See Also:
MessageProducer.setTimeToLive(long)

getQueue

public javax.jms.Queue getQueue()
                         throws JMSException
Get the queue associated with this queue sender.
Specified by:
getQueue in interface QueueSender
Returns:
the queue
Throws:
JMSException - if JMS fails to get queue for this queue sender due to some internal error.

setTransformation

public void setTransformation(java.lang.String transformation)
Set the transformation for the consumer
Specified by:
setTransformation in interface AQjmsQueueSender
Parameters:
transformation - the transformation used when getting messages
Throws:
if - the transformation could not be set

getTransformation

public java.lang.String getTransformation()
Get the transformation for the consumer
Specified by:
getTransformation in interface AQjmsQueueSender
Throws:
if - the transformation could not be set

send

public void send(javax.jms.Message message)
          throws JMSException
Send a message
Specified by:
send in interface QueueSender
Parameters:
message - The message that has to be sent
Throws:
JMSException - if JMS fails to send the message due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

send

public void send(javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
Send a message.
Specified by:
send in interface QueueSender
Parameters:
message - The message that has to be sent
deliveryMode - the delivery mode to use
priority - the priority for this message
timeToLive - the message's lifetime (in milliseconds)
Throws:
JMSException - if JMS fails to send the message due to some internal error.

send

public void send(javax.jms.Queue queue,
                 javax.jms.Message message)
          throws JMSException
Send a message.
Specified by:
send in interface QueueSender
Parameters:
queue - The destination queue where the message has to be sent. This overrides the default queue of the Message Producer.
message - The message that has to be sent
Throws:
JMSException - if JMS fails to send the message due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

send

public void send(javax.jms.Queue queue,
                 javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
Send a message.
Specified by:
send in interface QueueSender
Parameters:
queue - The destination queue where the message has to be sent. This overrides the default queue of the Message Producer.
message - The message that has to be sent
deliveryMode - The message delivery mode - persistent or non_persistent
priority - The priority of the message
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to send the message due to some internal error.

getTopic

public javax.jms.Topic getTopic()
                         throws JMSException
Get the topic associated with this publisher.
Specified by:
getTopic in interface TopicPublisher
Returns:
this publisher's topic
Throws:
JMSException - if JMS fails to get topic for this topic publisher due to some internal error.

publish

public void publish(javax.jms.Message message)
             throws JMSException
Publish a Message to the topic
Specified by:
publish in interface TopicPublisher
Parameters:
message - The message to be published
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

publish

public void publish(javax.jms.Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Publish a Message to the topic specifying delivery mode, priority and time to live to the topic.
Specified by:
publish in interface TopicPublisher
Parameters:
message - The message to be published
deliveryMode - The message delivery mode - persistent or non_persistent
priority - The priority of the message
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message)
             throws JMSException
Publish a Message to a topic for an unidentified message producer. Use the producer's default delivery mode, timeToLive and priority.
Specified by:
publish in interface TopicPublisher
Parameters:
topic - The topic to which to publish the message. This overrides the default topic of the Message Producer
message - The message to be published
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.
See Also:
MessageProducer.getDeliveryMode(), MessageProducer.getTimeToLive(), MessageProducer.getPriority()

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Publish a Message to a topic for an unidentified message producer, specifying delivery mode, priority and time to live.
Specified by:
publish in interface TopicPublisher
Parameters:
topic - The topic to which to publish the message. This overrides the default topic of the Message Producer
message - The message to be published
deliveryMode - The message delivery mode - persistent or non_persistent
priority - The priority of the message
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.

publish

public void publish(javax.jms.Message message,
                    oracle.jms.AQjmsAgent[] recipient_list)
             throws JMSException
Publish a Message to a specific list of recipients
Specified by:
publish in interface AQjmsTopicPublisher
Parameters:
message - The message to be published
recipient_list - The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
Throws:
JMSException - if JMS fails to publish the mesasge due to some internal error.

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message,
                    oracle.jms.AQjmsAgent[] recipient_list)
             throws JMSException
Publish a Message to a topic by specifying a list of recipients
Specified by:
publish in interface AQjmsTopicPublisher
Parameters:
topic - The topic to which to publish the message. This overrides the default topic of the Message Producer
message - The message to be published
recipient_list - The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.

publish

public void publish(javax.jms.Message message,
                    oracle.jms.AQjmsAgent[] recipient_list,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
Specified by:
publish in interface AQjmsTopicPublisher
Parameters:
message - The message to be published
recipient_list - The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode - The delivery mode - perisistent or non_persistent
priority - The priority of the message
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.

publish

public void publish(javax.jms.Topic topic,
                    javax.jms.Message message,
                    oracle.jms.AQjmsAgent[] recipient_list,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Publish a Message to a topic by specifying a list of recipients, delivery mode, priority and time to live
Specified by:
publish in interface AQjmsTopicPublisher
Parameters:
topic - The topic to which to publish the message. This overrides the default topic of the Message Producer
message - The message to be published
recipient_list - The list of recipients to which the message is published. The recipients are of type AQjmsAgent.
deliveryMode - The delivery mode - perisistent or non_persistent
priority - The priority of the message
timeToLive - the message time to live in milliseconds; zero is unlimited
Throws:
JMSException - if JMS fails to publish the messgae due to some internal error.

close

public void close()
           throws JMSException
Description copied from interface: MessageProducer
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.

Specified by:
close in interface MessageProducer
Overrides:
close in class oracle.jms.AQjmsObject
Throws:
JMSException - if the JMS provider fails to close the producer due to some internal error.

getDestination

public javax.jms.Destination getDestination()
                                     throws JMSException
Gets the destination associated with this MessageProducer.
Specified by:
getDestination in interface MessageProducer
Returns:
this producer's Destination/
Throws:
JMSException - if the JMS provider fails to get the destination for this MessageProducer due to some internal error.
Since:
1.1

send

public void send(javax.jms.Destination destination,
                 javax.jms.Message message)
          throws JMSException
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.

Specified by:
send in interface MessageProducer
Parameters:
destination - the destination to send this message to
message - the message to send
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid destination.
java.lang.UnsupportedOperationException - if a client uses this method with a MessageProducer that specified a destination at creation time.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination), MessageProducer

send

public void send(javax.jms.Destination destination,
                 javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
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.

Specified by:
send in interface MessageProducer
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)
Throws:
JMSException - if the JMS provider fails to send the message due to some internal error.
MessageFormatException - if an invalid message is specified.
InvalidDestinationException - if a client uses this method with an invalid destination.
Since:
1.1
See Also:
Session.createProducer(javax.jms.Destination)

Oracle® Streams Advanced Queuing Java API Reference
Release 1 (10.1)

B12023-01

Copyright © 2003, Oracle. All Rights Reserved.