public interface RegistrationHandle
JMSDestinationAvailabilityHelper
registration. A caller can then use this handle to unregister
the associated DestinationAvailabilityListener
and stop receiving destination availability updates.JMSDestinationAvailabilityHelper
Modifier and Type | Method and Description |
---|---|
javax.jms.ConnectionFactory |
lookupConnectionFactory(java.lang.String jndiName) |
javax.jms.Destination |
lookupDestination(java.lang.String jndiName) |
java.lang.Object |
runAs(java.security.PrivilegedExceptionAction action) |
void |
unregister()
Unregister the associated
DestinationAvailabilityListener
and stop receiving destination availability updates. |
void unregister()
DestinationAvailabilityListener
and stop receiving destination availability updates.javax.jms.ConnectionFactory lookupConnectionFactory(java.lang.String jndiName) throws javax.naming.NamingException
jndiName
- The JNDIName of the JMS connection factory.java.lang.IllegalStateException
- if the first onDestinationsAvailable()
callback has not been called.javax.naming.NamingException
- if the lookup is not successful.This method should not be called before the first onDestinationsAvailable() is received by the listener of this registration.
The lookup will be done using the JNDI context that the JMSDestinationAvailabilityHelper has established with the server on behalf of the right subject. If security credentials are provided in the JNDI properties when the registration is made with the JMSDestinationAvailabilityHelper, these credentials will be used. Otherwise, the original subject that is on the application thread when the registration is made will be used unless the JMS destination is running in a different WLS domain. In the cross-domain case, the anonymous subject is used, instead of the original subject. If the listener is running on a WLS and the resultant subject is server identity, anonymous credentials will be used.
javax.jms.Destination lookupDestination(java.lang.String jndiName) throws javax.naming.NamingException
jndiName
- The JNDIName of the JMS destination.java.lang.IllegalStateException
- if the first onDestinationsAvailable()
callback has not been called.javax.naming.NamingException
- if the lookup is not successful.This method should not be called before the first onDestinationsAvailable() is received by the listener of this registration.
The lookup will be done using the JNDI context that the JMSDestinationAvailabilityHelper has established with the server on behalf of the right subject. If security credentials are provided in the JNDI properties when the registration is made with the JMSDestinationAvailabilityHelper, these credentials will be used. Otherwise, the original subject that is on the application thread when the registration is made will be used unless the JMS destination is running in a different WLS domain. In the cross-domain case, the anonymous subject is used, instead of the original subject. If the listener is running on a WLS and the resultant subject is server identity, anonymous credentials will be used.
java.lang.Object runAs(java.security.PrivilegedExceptionAction action) throws java.security.PrivilegedActionException
action
- An instance of PrivilegedExceptionAction.java.lang.IllegalStateException
- if the first onDestinationsAvailable()
callback has not been called.java.security.PrivilegedActionException
- if the action failed.This method should not be called before the first onDestinationsAvailable() is received by the listener of this registration. The action will be done on behalf of the right subject, especially for cross WLS domain scenarios using Foreign JMS Server configuration.
The security credentials that are used to perform the action is determined as follows: 1. if the JMS destination is wrapped in a foreign JMS server configuration and the security credentials are provided in the JNDI properties, the foreign JNDI credentials in Foreign JMS Server configuration is used. 2. otherwise, if security credentials are provided in the JNDI properties when the registration is made with the JMSDestinationAvailabilityHelper, these credentials will be used unless the JMS destination is running in a different WLS domain. In the cross-domain case, the anonymous subject is used, instead of the original subject. 3. Otherwise, the original subject that is on the application thread when the registration is made will be used unless the JMS destination is running in a different WLS domain. In the cross-domain case, the anonymous subject is used, instead of the original subject. 4. If the listener is running on a WLS and the resultant subject is server identity, anonymous credentials will be used.