BEA Systems, Inc.

BEA WebLogic Server 9.0 API Reference


weblogic.jms.extensions
Interface WLMessageProducer

All Superinterfaces:
MessageProducer

public interface WLMessageProducer
extends MessageProducer

A WLMessageProducer provides methods not supported by javax.jms.MessageProducer.

WLMessageProducer provide methods for the following:

See Also:
MessageProducer
Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

Method Summary
 void forward(Destination destination, Message message)
          Forwards a message to a destination for an unidentified message producer.
 void forward(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)
          Forwards a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live.
 void forward(Message message)
          Forwards a message using the MessageProducer's default delivery mode, priority, and time to live.
 void forward(Message message, int deliveryMode, int priority, long timeToLive)
          Forwards a message to the destination, specifying delivery mode, priority, and time to live.
 int getCompressionThreshold()
           
 int getRedeliveryLimit()
          Get the redelivery limit for the producer.
 long getSendTimeout()
          Get the send timeout the producer.
 long getTimeToDeliver()
          Get the time to deliver for this producer; this is a relative time representing the delay in milliseconds before a sent message is made visible on its target destination.
 String getUnitOfOrder()
          Get the unit of order name associated with the producer.
 void setCompressionThreshold(int limit)
           
 void setRedeliveryLimit(int redeliveryLimit)
          Set the redelivery limit for the producer.
 void setSendTimeout(long sendTimeout)
          Set the send timeout for the producer.
 void setTimeToDeliver(long timeToDeliver)
          Set the time to deliver for this producer; this is a relative time representing the delay in milliseconds before a sent message is made visible on its target destination.
 void setUnitOfOrder()
          Set the Unit of Order for this producer with a system-generated name.
 void setUnitOfOrder(String name)
          Set the Unit of Order name for this producer.
 
Methods inherited from interface javax.jms.MessageProducer
close, getDeliveryMode, getDestination, getDisableMessageID, getDisableMessageTimestamp, getPriority, getTimeToLive, send, send, send, send, setDeliveryMode, setDisableMessageID, setDisableMessageTimestamp, setPriority, setTimeToLive
 

Method Detail

forward

public void forward(Destination destination,
                    Message message)
             throws JMSException
Forwards a message to a destination for an unidentified message producer. Uses the MessageProducer's default delivery mode, priority, and time to live. The forwarded message will have the same JMSMessageID, JMSTimestamp and JMSXUserID as the message before forwarding. 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 forwarded. The exactly value of the rest message attributes will be the same as the send verb listed below on the WLMessageProducer. send(Destination destination, Message message) throws JMSException;

Parameters:
destination - - the destination to forward this message to
message - - the message to forward
Throws:
JMSException - - if the JMS provider fails to forward the message due to some internal error or the message is not forwardable.
MessageFormatException - - if an invalid message is specified.
InvalidDestinationException - - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - - if a client uses this method with a MessageProducer that did not specify a destination at creation time.

forward

public void forward(Destination destination,
                    Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Forwards a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. The timeToLive is relative to the JMSTimestamp on the message and the absolute time will be calculated on the JMS server. The forwarded message will have the same JMSMessageID, JMSTimestamp and JMSXUserID as the message before forwarding. The exactly value of the rest message attributes on the forwarded message will be the same as the send verb listed below on the WLMessageProducer. send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive) throws JMSException;

Parameters:
destination - - the destination to forward this message to
message - - the message to forward
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 forward the message due to some internal error or the message is not forwardable.
MessageFormatException - - if an invalid message is specified.
InvalidDestinationException - - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - - if a client uses this method with a MessageProducer that did not specify a destination at creation time.

forward

public void forward(Message message)
             throws JMSException
Forwards a message using the MessageProducer's default delivery mode, priority, and time to live. The forwarded message will have the same JMSMessageID, JMSTimestamp and JMSXUserID as the message before forwarding. The exactly value of the rest message attributes on the forwarded message will be the same as the send verb listed below on the WLMessageProducer. send(Message message) throws JMSException;

Parameters:
message - - the message to forward
Throws:
JMSException - - if the JMS provider fails to send the message due to some internal error or the message is not forwardable.
MessageFormatException - - if an invalid message is specified.
InvalidDestinationException - - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - - if a client uses this method with a MessageProducer that did not specify a destination at creation time.

forward

public void forward(Message message,
                    int deliveryMode,
                    int priority,
                    long timeToLive)
             throws JMSException
Forwards a message to the destination, specifying delivery mode, priority, and time to live. The timeToLive is relative to the JMSTimestamp on the message and the absolute time will be calculated on the JMS server. The forwarded message will have the same JMSMessageID, JMSTimestamp and JMSXUserID as the message before forwarding. The exactly value of the rest message attributes on the forwarded message will be the same as the send verb listed below on the WLMessageProducer. send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException;

Parameters:
message - - the message to forward
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 forward the message due to some internal error or the message is not forwardable.
MessageFormatException - - if an invalid message is specified.
InvalidDestinationException - - if a client uses this method with a MessageProducer with an invalid destination.
UnsupportedOperationException - - if a client uses this method with a MessageProducer that did not specify a destination at creation time.

getCompressionThreshold

public int getCompressionThreshold()
                            throws JMSException
Throws:
JMSException

getRedeliveryLimit

public int getRedeliveryLimit()
                       throws JMSException
Get the redelivery limit for the producer. This is the number of times a message will be redelivered after a recover or rollback. When this limit is reached, the message is moved to the error destination if one is configured, otherwise, the message is deleted. This limit may be overridden by a configured redelivery limit for the entire destination.

Returns:
The number of times to redeliver the message
Throws:
JMSException - if a JMS error occurs.
See Also:
weblogic.jms.extensions.WLMessage.getJMSRedeliveryLimit(), weblogic.jms.extensions.WLMessage.setJMSRedeliveryLimit(int)

getSendTimeout

public long getSendTimeout()
                    throws JMSException
Get the send timeout the producer. This is the maximum time the producer will wait (in milliseconds) for space when sending a message. The default value is configurable on the connection factory used to create this producer.

Returns:
the send timeout in milliseconds
Throws:
JMSException - if a JMS error occurs.

getTimeToDeliver

public long getTimeToDeliver()
                      throws JMSException
Get the time to deliver for this producer; this is a relative time representing the delay in milliseconds before a sent message is made visible on its target destination. The default time to deliver is 0; this default can be changed by modifying the configuration of the connection factory used to create this producer. If the time to deliver on the producer is set to -1 (the default), then this method will return the default time to deliver, which is the configurable value on the connection factory used to create this producer.

Returns:
The time to deliver for the message.
Throws:
JMSException - if a JMS error occurs.
See Also:
setTimeToDeliver(long), weblogic.jms.extensions.WLMessage.getJMSDeliveryTime()

getUnitOfOrder

public String getUnitOfOrder()
                      throws JMSException
Get the unit of order name associated with the producer.

Returns:
the unit of order name or null if none is associated with the producer.
Throws:
JMSException - if a JMS error occurs.

setCompressionThreshold

public void setCompressionThreshold(int limit)
                             throws JMSException
Throws:
JMSException

setRedeliveryLimit

public void setRedeliveryLimit(int redeliveryLimit)
                        throws JMSException
Set the redelivery limit for the producer. This is the number of times a message will be redelivered after a recover or rollback. When this limit is reached, the message is moved to the error destination if one is configured, otherwise, the message is deleted. This limit may be overridden by a configured redelivery limit for the entire destination. A redelivery limit of -1 (the default) implies that there is no redelivery limit unless a limit is specified on the destination.

Parameters:
redeliveryLimit - the number of times to redeliver the message
Throws:
JMSException - if a JMS error occurs.
See Also:
weblogic.jms.extensions.WLMessage.getJMSRedeliveryLimit(), weblogic.jms.extensions.WLMessage.setJMSRedeliveryLimit(int)

setSendTimeout

public void setSendTimeout(long sendTimeout)
                    throws JMSException
Set the send timeout for the producer. This is the maximum time the producer will wait (in milliseconds) for space when sending a message. The default value is configurable on the connection factory used to create this producer.

Throws:
JMSException - if a JMS error occurs.

setTimeToDeliver

public void setTimeToDeliver(long timeToDeliver)
                      throws JMSException
Set the time to deliver for this producer; this is a relative time representing the delay in milliseconds before a sent message is made visible on its target destination. The default time to deliver is 0; this default can be changed by modifying the configuration of the connection factory used to create this producer. Setting the time to deliver to -1 forces use of this default. Setting the time to deliver to anything greater than or equal to 0 overrides this default.

Parameters:
timeToDeliver - The time to deliver this message.
Throws:
JMSException - if a JMS error occurs.
See Also:
getTimeToDeliver(), weblogic.jms.extensions.WLMessage.getJMSDeliveryTime()

setUnitOfOrder

public void setUnitOfOrder()
                    throws JMSException
Set the Unit of Order for this producer with a system-generated name. This method is used when the application does not require a specific name for the unit of order crated by this producer. The system creates a statistically unique name for the unit of order.

Throws:
JMSException - if a JMS error occurs.
UnsupportedOperationException - if the frontend is older than 9.0 (diablo)

setUnitOfOrder

public void setUnitOfOrder(String name)
                    throws JMSException
Set the Unit of Order name for this producer. When name is null, there is no Unit of Order. Messages will be produced with this name attached. This makes sure that messages belonging to the same unit will be processed sequentially by consumers. A producer can have a default value which is configurable on the connection factory used to create this producer.

Throws:
JMSException - if a JMS error occurs.
UnsupportedOperationException - if the frontend is older than 9.0 (diablo)

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs90
Copyright 2005 BEA Systems Inc.