BEA Systems, Inc.

WebLogic Server 6.0sp2 API Reference

weblogic.jms.extensions
Interface WLSession

All Known Subinterfaces:
WLQueueSession, WLTopicSession

public interface WLSession
extends javax.jms.Session

A WLSession provides fields and methods not supported by javax.jms.Session.

WLSession provides methods for:

WLSession also supports NO_ACKNOWLEDGE and MULTICAST_NO_ACKNOWLEDGE acknowledge modes.

Author:
Copyright (c) 2000 by BEA Systems, Inc., All Rights Reserved.
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
Session, QueueSession, TopicSession

Field Summary
static int KEEP_NEW
          Multicast overrun policy specifying that the most recent messages should be saved and the oldest ones discarded, as needed, so as not to exceed the message maximum.
static int KEEP_OLD
          Multicast overrun policy specifying that the oldest messages should be saved and the most recent ones discarded, as needed, so as not to exceed the message maximum.
static int MULTICAST_NO_ACKNOWLEDGE
          Multicast mode with no acknowledge required.
static int NO_ACKNOWLEDGE
          No acknowledge is required.
 
Fields inherited from class javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE
 
Method Summary
 XMLMessage createXMLMessage()
          Create an XMLMessage.
 XMLMessage createXMLMessage(java.lang.String string)
          Create an initialized XMLMessage.
 int getMessagesMaximum()
          Get the maximum number of messages that may exist for an asynchronous session that have not yet been passed to the message listener.
 int getOverrunPolicy()
          Get overrun policy for multicast sessions.
 void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
          Set an exception listener for this session.
 void setMessagesMaximum(int messagesMaximum)
          Set the maximum number of messages that may exist for an asynchronous session that have not yet been passed to the message listener.
 void setOverrunPolicy(int policy)
          Set overrun policy for multicast sessions.
 
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
 

Field Detail

NO_ACKNOWLEDGE

public static final int NO_ACKNOWLEDGE
No acknowledge is required.

Messages sent to a NO_ACKNOWLEDGE session are immediately deleted from the server. Messages received in this mode are not recovered, and as a result messages may be lost and/or duplicate message may be delivered if an initial attempt to deliver a message fails.

This mode is supported for applications that do not require the quality of service provided by session acknowledge, and that do not want to incur the associated overhead.

You should avoid using this mode if your application cannot handle duplicate messages.


MULTICAST_NO_ACKNOWLEDGE

public static final int MULTICAST_NO_ACKNOWLEDGE
Multicast mode with no acknowledge required.

Messages sent to a MULTICAST_NO_ACKNOWLEDGE session share the same characteristics as NO_ACKNOWLEDGE mode.

This mode is supported for applications that want to support multicasting, and that do not require the quality of service provided by session acknowledge.

You should avoid using this mode if your application is unable to handle duplicate messages, which can result if a message fails to be delivered during the first attempt.


KEEP_OLD

public static final int KEEP_OLD
Multicast overrun policy specifying that the oldest messages should be saved and the most recent ones discarded, as needed, so as not to exceed the message maximum.

KEEP_NEW

public static final int KEEP_NEW
Multicast overrun policy specifying that the most recent messages should be saved and the oldest ones discarded, as needed, so as not to exceed the message maximum.
Method Detail

createXMLMessage

public XMLMessage createXMLMessage()
                            throws javax.jms.JMSException
Create an XMLMessage. An XMLMessage is used to send a message containing XML content.

Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
createXMLMessage(String)

createXMLMessage

public XMLMessage createXMLMessage(java.lang.String string)
                            throws javax.jms.JMSException
Create an initialized XMLMessage. An XMLMessage is used to send a message containing XML content.

Parameters:
string - the string used to initialize the message.
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
createXMLMessage()

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
                          throws javax.jms.JMSException
Set an exception listener for this session.

If a JMS provider detects a serious problem with a session, it will inform the session's exception listener, if one has been registered. It informs the exception listener by calling the listener's onException() method and passing a JMSException describing the problem.

The exception listener allows a client to be asynchronously notified of a problem. Some sessions only consume messages, so they would have no other way to learn the session has failed.

A session serializes execution of its exception listener.

A JMS provider should attempt to resolve session problems prior to notifying the client.

Parameters:
exceptionListener - the exception listener.
Throws:
javax.jms.JMSException - general exception if JMS implementation fails to set the exception listener for this session

getMessagesMaximum

public int getMessagesMaximum()
                       throws javax.jms.JMSException
Get the maximum number of messages that may exist for an asynchronous session that have not yet been passed to the message listener.

A value of -1 indicates that there is no limit on the number of messages. In this case, however, the limit is set to the amount of remaining virtual memory.

Returns:
the message maximum set for this session
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
setMessagesMaximum(int)

setMessagesMaximum

public void setMessagesMaximum(int messagesMaximum)
                        throws javax.jms.JMSException
Set the maximum number of messages that may exist for an asynchronous session that have not yet been passed to the message listener.

A value of -1 indicates that there is no limit on the number of messages. In this case, however, the limit is set to the amount of remaining virtual memory.

When the number of messages reaches the specified value:

For multicast sessions, when a connection is stopped, messages will continue to be delivered, but only until the specified maximum value is reached. Once this value is reached, messages will be discarded based on the overrun policy.

Parameters:
messagesMaximum - the maximum number of messages allowed, valid values are -1, and 1 through 2^63-1 (default is 10).
Throws:
javax.jms.JMSException - if a JMS error occurs
See Also:
getMessagesMaximum()

getOverrunPolicy

public int getOverrunPolicy()
                     throws javax.jms.JMSException
Get overrun policy for multicast sessions.

Returns:
the overrun policy set for this session
Throws:
javax.jms.JMSException - general exception if JMS implementation fails to set the exception listener for this session
See Also:
setOverrunPolicy(int)

setOverrunPolicy

public void setOverrunPolicy(int policy)
                      throws javax.jms.JMSException
Set overrun policy for multicast sessions.

When the number of messages reaches the message maximum, messages are discarded based on the specified policy.

If set to KeepNew, the most recent messages are given priority over the oldest messages, and the oldest messages are discarded, as needed.

If set to KeepOld, the oldest messages are given priority over the most recent messages, and the most recent messages are discarded, as needed.

Message age is defined by the order of receipt, not by the JMSTimestamp value.

Parameters:
policy - the overrun policy.
Throws:
javax.jms.JMSException - general exception if JMS implementation fails to set the exception listener for this session
See Also:
getOverrunPolicy()

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs60