Package bitronix.tm.resource.jms
Class JndiXAConnectionFactory
java.lang.Object
bitronix.tm.resource.jms.JndiXAConnectionFactory
- All Implemented Interfaces:
javax.jms.XAConnectionFactory
XAConnectionFactory implementation that wraps another XAConnectionFactory implementation available
in some JNDI tree.- Author:
- lorban
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.jms.XAConnectionjavax.jms.XAConnectioncreateXAConnection(String userName, String password) javax.jms.XAJMSContextjavax.jms.XAJMSContextcreateXAContext(String userName, String password) The extra JNDI environment properties added the theInitialContext's environment upon creation.getName()The JNDI name under which theXAConnectionFactoryis available.protected voidinit()voidsetExtraJndiProperties(Properties extraJndiProperties) Set the extra JNDI environment properties added the theInitialContext's environment upon creation.voidsetInitialContextFactory(String initialContextFactory) voidSet the JNDI name under which theXAConnectionFactoryis available.voidsetProviderUrl(String providerUrl) voidsetSecurityCredentials(String securityCredentials) voidsetSecurityPrincipal(String securityPrincipal) voidsetUrlPkgPrefixes(String urlPkgPrefixes)
-
Constructor Details
-
JndiXAConnectionFactory
public JndiXAConnectionFactory()
-
-
Method Details
-
getInitialContextFactory
- Returns:
- the
Context.INITIAL_CONTEXT_FACTORYvalue.
-
setInitialContextFactory
Set theContext.INITIAL_CONTEXT_FACTORYof the JNDIContextused to fetch theXAConnectionFactory. If not set, theContextis created without the environment parameter, using the default constructor. This means all other properties (providerUrl, urlPkgPrefixes, extraJndiProperties...) are then ignored.- Parameters:
initialContextFactory- theContext.INITIAL_CONTEXT_FACTORYvalue.
-
getProviderUrl
- Returns:
- the
Context.PROVIDER_URLvalue.
-
setProviderUrl
- Parameters:
providerUrl- theContext.PROVIDER_URLvalue.
-
getUrlPkgPrefixes
- Returns:
- the
Context.URL_PKG_PREFIXESvalue.
-
setUrlPkgPrefixes
- Parameters:
urlPkgPrefixes- theContext.URL_PKG_PREFIXESvalue.
-
getSecurityPrincipal
- Returns:
- the
Context.SECURITY_PRINCIPALvalue.
-
setSecurityPrincipal
Set theContext.SECURITY_PRINCIPALof the JNDIContextused to fetch theXAConnectionFactory. IfContext.INITIAL_CONTEXT_FACTORYandContext.PROVIDER_URLare not set, this value is ignored.- Parameters:
securityPrincipal- theContext.SECURITY_PRINCIPALvalue.
-
getSecurityCredentials
- Returns:
- the
Context.SECURITY_CREDENTIALSvalue.
-
setSecurityCredentials
Set theContext.SECURITY_CREDENTIALSof the JNDIContextused to fetch theXAConnectionFactory. IfContext.INITIAL_CONTEXT_FACTORYandContext.PROVIDER_URLare not set, this value is ignored.- Parameters:
securityCredentials- theContext.SECURITY_CREDENTIALSvalue.
-
getName
The JNDI name under which theXAConnectionFactoryis available.- Returns:
- The JNDI name.
-
setName
Set the JNDI name under which theXAConnectionFactoryis available.- Parameters:
name- the JNDI name.
-
getExtraJndiProperties
The extra JNDI environment properties added the theInitialContext's environment upon creation.- Returns:
- The extra JNDI environment properties.
-
setExtraJndiProperties
Set the extra JNDI environment properties added the theInitialContext's environment upon creation.- Parameters:
extraJndiProperties- The extra JNDI environment properties.
-
init
- Throws:
NamingException
-
createXAConnection
public javax.jms.XAConnection createXAConnection() throws javax.jms.JMSException- Specified by:
createXAConnectionin interfacejavax.jms.XAConnectionFactory- Throws:
javax.jms.JMSException
-
createXAConnection
public javax.jms.XAConnection createXAConnection(String userName, String password) throws javax.jms.JMSException - Specified by:
createXAConnectionin interfacejavax.jms.XAConnectionFactory- Throws:
javax.jms.JMSException
-
createXAContext
public javax.jms.XAJMSContext createXAContext()- Specified by:
createXAContextin interfacejavax.jms.XAConnectionFactory
-
createXAContext
- Specified by:
createXAContextin interfacejavax.jms.XAConnectionFactory
-