|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WLSession
A WLSession provides fields and methods that are not supported by javax.jms.Session.
.
WLSession provides methods for the following:
WLSession also supports NO_ACKNOWLEDGE and MULTICAST_NO_ACKNOWLEDGE acknowledge modes.
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 interface javax.jms.Session |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Method Summary | |
---|---|
abstract void |
acknowledge() Acknowledge all the messages received by this session. |
abstract void |
acknowledge(Message message) Acknowledge all the messages received by this session. |
abstract XMLMessage |
createXMLMessage() Create an XMLMessage. |
abstract XMLMessage |
createXMLMessage(Document doc) Create an initialized XMLMessage from a DOM Document containing XML. |
abstract XMLMessage |
createXMLMessage(String xml) Create an initialized XMLMessage from a String containing XML. |
abstract int |
getMessagesMaximum() The maximum number of messages that may exist for an asynchronous session, which have not yet been passed to the message listener. |
abstract int |
getOverrunPolicy() Get overrun policy for multicast sessions. |
abstract long |
getRedeliveryDelay() The redelivery delay for this session; this defines the delay in milliseconds before rolled back or recovered messages are redelivered. |
abstract void |
setExceptionListener(ExceptionListener exceptionListener) Set an exception listener for this session. |
abstract void |
setMessagesMaximum(int messagesMaximum) Set the maximum number of messages that may exist for an asynchronous session, which have not yet been passed to the message listener. |
abstract void |
setOverrunPolicy(int policy) Set overrun policy for multicast sessions. |
abstract void |
setRedeliveryDelay(long redeliveryDelay) Set the redelivery delay for this consumer; this defines the delay in milliseconds before rolled back or recovered messages are redelivered. |
abstract void |
unsubscribe(Topic topic, String name) Unsubscribe a durable subscription on a particular topic or distributed topic member. |
Field Detail |
---|
static final int NO_ACKNOWLEDGE
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 a 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.
static final int MULTICAST_NO_ACKNOWLEDGE
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 occur if a message fails to be delivered during the first attempt.
static final int KEEP_OLD
static final int KEEP_NEW
Method Detail |
---|
XMLMessage createXMLMessage() throws JMSException
JMSException
- if a JMS error occurs.WLSession.createXMLMessage(String)
XMLMessage createXMLMessage(String xml) throws JMSException
xml
- The XML content represented as a stringJMSException
- if a JMS error occurs.WLSession.createXMLMessage()
XMLMessage createXMLMessage(Document doc) throws JMSException
doc
- The XML content represented as a DOM DocumentJMSException
- if a JMS error occurs.WLSession.createXMLMessage()
void setExceptionListener(ExceptionListener exceptionListener) throws JMSException
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 that 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.
exceptionListener
- The exception listener.JMSException
- general exception if JMS implementation fails to set the exception listener for this session.int getMessagesMaximum() throws JMSException
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.
JMSException
- if a JMS error occurs.WLSession.setMessagesMaximum(int)
void setMessagesMaximum(int messagesMaximum) throws JMSException
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, the following occurs:
For multicast sessions, when a connection is stopped, messages will continue to be accumulated, but only until the specified maximum value is reached. Once this value is reached, messages will be discarded based on the overrun policy.
messagesMaximum
- The maximum number of messages allowed, valid values are -1, and 1 through 2^63-1 (default is 10).JMSException
- if a JMS error occurs.WLSession.getMessagesMaximum()
int getOverrunPolicy() throws JMSException
JMSException
- general exception if the JMS implementation fails to set the exception listener for this session.WLSession.setOverrunPolicy(int)
void setOverrunPolicy(int policy) throws JMSException
When the number of messages reaches the message maximum, messages are discarded based on the specified policy, as follows:
Message age is defined by the order of receipt, not by the JMSTimestamp value.
policy
- The overrun policy.JMSException
- general exception if JMS implementation fails to set the exception listener for this session.WLSession.getOverrunPolicy()
long getRedeliveryDelay() throws JMSException
JMSException
- if a JMS error occurs.WLSession.setRedeliveryDelay(long)
void setRedeliveryDelay(long redeliveryDelay) throws JMSException
Performance Note: If any consumers for remote destinations already exist on this session, calling this method results in a network call(s) in order to disseminate the changed delay value to them.
redeliveryDelay
- Redelivery delay for this session.JMSException
- if a JMS error occurs.WLSession.getRedeliveryDelay()
void acknowledge() throws JMSException
JMSException
- if a JMS error occursvoid acknowledge(Message message) throws JMSException
JMSException
- if a JMS error occursvoid unsubscribe(Topic topic, String name) throws JMSException
Although this API can be used for both Unrestricted and Restricted Client ID cases, if a subscription is created using an Unrestricted Client ID, it can only be unsubscribed using this method from a session that has the same Unrestricted Client ID.
topic
- the topic or distributed topic member that the subscription is onname
- the name used to identify this subscriptionJMSException
- if the session fails to unsubscribe to the durable subscription due to some internal error.InvalidDestinationException
- if an invalid subscription name, a null topic, or a distributed topic is specified.
|
Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |