|
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 WLJMSContext
A WLJMSContext provides fields and methods that are not supported by javax.jms.JMSContext
. WLJMSContext provides the same extension features as WLConnection WLJMSContext also provides the same extension features as WLSession. These include:
WLSession also supports NO_ACKNOWLEDGE and MULTICAST_NO_ACKNOWLEDGE acknowledge modes.
JMSContext
Field Summary | |
---|---|
static String |
CLIENT_ID_POLICY_RESTRICTED Only one connection that uses this policy exists in a cluster at any given time for a particular ClientID . |
static String |
CLIENT_ID_POLICY_UNRESTRICTED Connections created using this policy can specify any ClientID , even when other restricted or unrestricted connections already use the same ClientID . |
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. |
static String |
RECONNECT_POLICY_ALL |
static String |
RECONNECT_POLICY_NONE |
static String |
RECONNECT_POLICY_PRODUCER |
static String |
SUBSCRIPTION_EXCLUSIVE All subscribers created using this connection do not share subscriptions with any other subscribers. |
static String |
SUBSCRIPTION_SHARABLE Subscribers created using this connection factory can share their subscriptions with other subscribers, regardless of whether those subscribers are created using the same connection factory or a different connection factory. |
Fields inherited from interface javax.jms.JMSContext |
---|
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED |
Method Summary | |
---|---|
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 String |
getClientIDPolicy() The ClientIdPolicy on this connection. |
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 |
getReconnectBlockingMillis() The maximum length of time that any synchronous JMS calls block the calling thread before giving up on a JMS client reconnect in progress. |
abstract String |
getReconnectPolicy() The JMS client reconnection policy after a lost network connection with a server or upon a server reboot. |
abstract long |
getRedeliveryDelay() The redelivery delay for this session; this defines the delay in milliseconds before rolled back or recovered messages are redelivered. |
abstract String |
getSubscriptionSharingPolicy() The SubscriptionSharingPolicy on this connection. |
abstract long |
getTotalReconnectPeriodMillis() The maximum length of time that JMS client operations continue to try to reconnect to the server. |
abstract void |
setClientID(String clientID, String clientIDPolicy) Sets the ClientID and ClientIdPolicy on the connection. |
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 |
setReconnectBlockingMillis(long timeout) Sets the maximum length of time that any synchronous JMS calls, such as a producer.send() , consumer.receive() , or session.createBrowser() , will block the calling thread before giving up on a JMS client reconnect in progress. |
abstract void |
setReconnectPolicy(String reconnectPolicy) Sets the JMS client reconnection policy after a lost network connection with a server or upon a server reboot. |
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 |
setSessionExceptionListener(ExceptionListener exceptionListener) Set an exception listener for this session. |
abstract void |
setSubscriptionSharingPolicy(String subscriptionSharingPolicy) Sets the SubscriptionSharingPolicy on this connection. |
abstract void |
setTotalReconnectPeriodMillis(long timeout) Sets the maximum length of time that JMS client operations continue to try to reconnect to the server after either the initial network disconnect or the last synchronous call attempt, whichever occurred most recently, before giving up retrying. |
abstract void |
unsubscribe(Topic topic, String name) Unsubscribe a durable subscription on a particular topic or distributed topic member. |
Field Detail |
---|
static final String RECONNECT_POLICY_NONE
WLJMSContext.setReconnectPolicy(java.lang.String)
, WLJMSContext.getReconnectPolicy()
static final String RECONNECT_POLICY_PRODUCER
WLJMSContext.setReconnectPolicy(java.lang.String)
, WLJMSContext.getReconnectPolicy()
static final String RECONNECT_POLICY_ALL
WLJMSContext.setReconnectPolicy(java.lang.String)
, WLJMSContext.getReconnectPolicy()
static final String CLIENT_ID_POLICY_RESTRICTED
ClientID
.
WLJMSContext.getClientIDPolicy()
, WLJMSContext.setClientID(String,String)
static final String CLIENT_ID_POLICY_UNRESTRICTED
ClientID
, even when other restricted or unrestricted connections already use the same ClientID
.
WLJMSContext.getClientIDPolicy()
, WLJMSContext.setClientID(String,String)
static final String SUBSCRIPTION_EXCLUSIVE
WLJMSContext.getSubscriptionSharingPolicy()
, WLJMSContext.setSubscriptionSharingPolicy(java.lang.String)
static final String SUBSCRIPTION_SHARABLE
WLJMSContext.getSubscriptionSharingPolicy()
, WLJMSContext.setSubscriptionSharingPolicy(java.lang.String)
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 |
---|
void setReconnectPolicy(String reconnectPolicy) throws IllegalArgumentException
Sets the JMS client reconnection policy after a lost network connection with a server or upon a server reboot.
weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_NONE
-- Prevents reconnection attempts.weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_PRODUCER
-- Explicitly refreshes Producer objects and implicitly refreshes any related Session and Connection objects. However, this value does not refresh Consumers, QueueBrowsers, and Connections with a configured ClientID for a durable subscriber.weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_ALL
-- Explicitly refreshes all Consumer and Producer objects and implicitly refreshes any related Session and Connection objects. However, this value does not refresh QueueBrowsers and Connections with a configured ClientID for a durable subscriber.reconnectPolicy
- reconnectPolicy is the new reconnect policy.IllegalArgumentException
- when the argument is not: weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_NONE weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_PRODUCER weblogic.jms.extensions.WLJMSContext.RECONNECT_POLICY_ALLWLJMSContext.getReconnectPolicy()
, WLJMSContext.RECONNECT_POLICY_NONE
, WLJMSContext.RECONNECT_POLICY_PRODUCER
, WLJMSContext.RECONNECT_POLICY_ALL
, weblogic.jms.extensions.WLJMSContext#getJMSRedeliveryLimit()
String getReconnectPolicy()
WLJMSContext.setReconnectPolicy(java.lang.String)
void setReconnectBlockingMillis(long timeout) throws IllegalArgumentException
Sets the maximum length of time that any synchronous JMS calls, such as a producer.send()
, consumer.receive()
, or session.createBrowser()
, will block the calling thread before giving up on a JMS client reconnect in progress.
timeout
- The number of milliseconds JMS operations will wait trying to reconnect to a disconnected server before throwing a JMSException.
When the timeout is zero, the reconnect starts but this call does not block waiting for the reconnected objects.
When the timeout is -1, the call blocks as long as reconnects are possible. For example, send() can block until close() is called, and send() will throw a JMSException.
IllegalArgumentExcaption
- is thrown when timeout is less than -1.IllegalArgumentException
WLJMSContext.getReconnectBlockingMillis()
long getReconnectBlockingMillis()
The maximum length of time that any synchronous JMS calls block the calling thread before giving up on a JMS client reconnect in progress.
WLJMSContext.setReconnectBlockingMillis(long)
void setTotalReconnectPeriodMillis(long timeout) throws IllegalArgumentException
Sets the maximum length of time that JMS client operations continue to try to reconnect to the server after either the initial network disconnect or the last synchronous call attempt, whichever occurred most recently, before giving up retrying.
timeout
- The number of milliseconds that JMS reconnect timers are permitted to reconnect a disconnected server.
When the timeout is -1, there is no limit. Reconnection timers are always scheduled until close() is called.
IllegalArgumentExcaption
- is thrown when timeout is less than -1.IllegalArgumentException
WLJMSContext.getTotalReconnectPeriodMillis()
long getTotalReconnectPeriodMillis()
The maximum length of time that JMS client operations continue to try to reconnect to the server.
WLJMSContext.setTotalReconnectPeriodMillis(long)
void setClientID(String clientID, String clientIDPolicy) throws IllegalArgumentException
The ClientID and ClientIdPolicy can be set administratively through the connection factory. If a client sets the ClientID explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the ClientID throws an IllegalStateException
. If the ClientID is specified on the connection factory, an attempt to use this setter to change it throws IllegalStateException
. If the ClientIdPolicy is specified on the connection factory without a ClientID, calling this setter with a ClientID and a different ClientIdPolicy overrides the policy as well as sets the ClientID.
Note: A durable subscription that is created using a Unrestricted client ID can only be unsubscribed using WLSession.unsubscribe(String name, Topic topic) method. An attempt of unsubscribing such a subscription using standard javax.jms.Session.unsubscribe(String name) will get an InvalidDestinationException
.
clientID
- the ClientID to be setclientIDPolicy
- the ClientIdPolicy to be setJMSException
- if the JMS provider fails to set the client ID for this connection due to some internal error.IllegalStateRuntimeException
- if the JMS client attempts to set a connection's client ID at the wrong time or when it has been administratively configured.InvalidClientIDRuntimeException
- if the JMS client specifies an invalid or duplicate client ID using the RESTRICTED policy.IllegalArgumentException
- if the policy is not valid.WLJMSContext.getClientIDPolicy()
, WLJMSContext.CLIENT_ID_POLICY_RESTRICTED
, WLJMSContext.CLIENT_ID_POLICY_UNRESTRICTED
String getClientIDPolicy()
WLJMSContext.setClientID(String,String)
, WLJMSContext.CLIENT_ID_POLICY_RESTRICTED
, WLJMSContext.CLIENT_ID_POLICY_UNRESTRICTED
String getSubscriptionSharingPolicy()
WLJMSContext.setSubscriptionSharingPolicy(java.lang.String)
, WLJMSContext.SUBSCRIPTION_EXCLUSIVE
, WLJMSContext.SUBSCRIPTION_SHARABLE
void setSubscriptionSharingPolicy(String subscriptionSharingPolicy) throws IllegalArgumentException
subscriptionSharingPolicy
- new subscription sharing policy to be set.JMSRuntimeException
- if the JMS provider fails to set the Subsrciption Sharing Policy for this connection due to some internal error.IllegalArgumentException
- if the policy is not validWLJMSContext.SUBSCRIPTION_EXCLUSIVE
, WLJMSContext.SUBSCRIPTION_SHARABLE
, WLJMSContext.getSubscriptionSharingPolicy()
XMLMessage createXMLMessage()
JMSRuntimeException
- if a JMS error occurs.WLJMSContext.createXMLMessage(String)
XMLMessage createXMLMessage(String xml)
xml
- The XML content represented as a stringJMSRuntimeException
- if a JMS error occurs.WLJMSContext.createXMLMessage()
XMLMessage createXMLMessage(Document doc)
doc
- The XML content represented as a DOM DocumentJMSRuntimeException
- if a JMS error occurs.WLJMSContext.createXMLMessage()
void setSessionExceptionListener(ExceptionListener exceptionListener)
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.JMSRuntimeException
- general exception if JMS implementation fails to set the exception listener for this session.int getMessagesMaximum()
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.
JMSRuntimeException
- if a JMS error occurs.WLJMSContext.setMessagesMaximum(int)
void setMessagesMaximum(int messagesMaximum)
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.WLJMSContext.getMessagesMaximum()
int getOverrunPolicy()
JMSRuntimeException
- general exception if the JMS implementation fails to set the exception listener for this session.WLJMSContext.setOverrunPolicy(int)
void setOverrunPolicy(int policy)
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.JMSRuntimeException
- general exception if JMS implementation fails to set the exception listener for this session.WLJMSContext.getOverrunPolicy()
long getRedeliveryDelay()
JMSRuntimeException
- if a JMS error occurs.WLJMSContext.setRedeliveryDelay(long)
void setRedeliveryDelay(long redeliveryDelay)
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.JMSRuntimeException
- if a JMS error occurs.WLJMSContext.getRedeliveryDelay()
void acknowledge(Message message)
IllegalStateRuntimeException
- if the JMSContext is container-managed (injected)JMSRuntimeException
- if a JMS error occursvoid unsubscribe(Topic topic, String name)
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 subscriptionJMSRuntimeException
- if the session fails to unsubscribe to the durable subscription due to some internal error.InvalidDestinationRuntimeException
- 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 |