bitronix.tm.resource.jms
Class JndiXAConnectionFactory

java.lang.Object
  extended bybitronix.tm.resource.jms.JndiXAConnectionFactory
All Implemented Interfaces:
javax.jms.XAConnectionFactory

public class JndiXAConnectionFactory
extends java.lang.Object
implements javax.jms.XAConnectionFactory

XAConnectionFactory implementation that wraps another XAConnectionFactory implementation available in some JNDI tree.

© Bitronix Software

Author:
lorban

Constructor Summary
JndiXAConnectionFactory()
           
 
Method Summary
 javax.jms.XAConnection createXAConnection()
           
 javax.jms.XAConnection createXAConnection(java.lang.String userName, java.lang.String password)
           
 java.util.Properties getExtraJndiProperties()
          The extra JNDI environment properties added the the InitialContext's environment upon creation.
 java.lang.String getInitialContextFactory()
          The Context.INITIAL_CONTEXT_FACTORY of the JNDI Context used to fetch the XAConnectionFactory.
 java.lang.String getName()
          The JNDI name under which the XAConnectionFactory is available.
 java.lang.String getProviderUrl()
          The Context.PROVIDER_URL of the JNDI Context used to fetch the XAConnectionFactory.
 java.lang.String getSecurityCredentials()
          The Context.SECURITY_CREDENTIALS of the JNDI Context used to fetch the XAConnectionFactory.
 java.lang.String getSecurityPrincipal()
          The Context.SECURITY_PRINCIPAL of the JNDI Context used to fetch the XAConnectionFactory.
 java.lang.String getUrlPkgPrefixes()
          The Context.URL_PKG_PREFIXES of the JNDI Context used to fetch the XAConnectionFactory.
protected  void init()
           
 boolean isNarrowJndiObject()
          Should PortableRemoteObject.narrow(Object, Class) be applied on the object looked up from JNDI before trying to cast it to XAConnectionFactory ?
 void setExtraJndiProperties(java.util.Properties extraJndiProperties)
          Set the extra JNDI environment properties added the the InitialContext's environment upon creation.
 void setInitialContextFactory(java.lang.String initialContextFactory)
          Set the Context.INITIAL_CONTEXT_FACTORY of the JNDI Context used to fetch the XAConnectionFactory.
 void setName(java.lang.String name)
          Set the JNDI name under which the XAConnectionFactory is available.
 void setNarrowJndiObject(boolean narrowJndiObject)
          Set if PortableRemoteObject.narrow(Object, Class) should be applied on the object looked up from JNDI before trying to cast it to XAConnectionFactory ?
 void setProviderUrl(java.lang.String providerUrl)
          Set the Context.PROVIDER_URL of the JNDI Context used to fetch the XAConnectionFactory.
 void setSecurityCredentials(java.lang.String securityCredentials)
          Set the Context.SECURITY_CREDENTIALS of the JNDI Context used to fetch the XAConnectionFactory.
 void setSecurityPrincipal(java.lang.String securityPrincipal)
          Set the Context.SECURITY_PRINCIPAL of the JNDI Context used to fetch the XAConnectionFactory.
 void setUrlPkgPrefixes(java.lang.String urlPkgPrefixes)
          Set the Context.URL_PKG_PREFIXES of the JNDI Context used to fetch the XAConnectionFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiXAConnectionFactory

public JndiXAConnectionFactory()
Method Detail

getInitialContextFactory

public java.lang.String getInitialContextFactory()
The Context.INITIAL_CONTEXT_FACTORY of the JNDI Context used to fetch the XAConnectionFactory.

Returns:
the Context.INITIAL_CONTEXT_FACTORY value.

setInitialContextFactory

public void setInitialContextFactory(java.lang.String initialContextFactory)
Set the Context.INITIAL_CONTEXT_FACTORY of the JNDI Context used to fetch the XAConnectionFactory. If not set, the Context is created without the environment parameter, using the default constructor. This means all other properties (providerUrl, urlPkgPrefixes, extraJndiProperties...) are then ignored.

Parameters:
initialContextFactory - the Context.INITIAL_CONTEXT_FACTORY value.

getProviderUrl

public java.lang.String getProviderUrl()
The Context.PROVIDER_URL of the JNDI Context used to fetch the XAConnectionFactory.

Returns:
the Context.PROVIDER_URL value.

setProviderUrl

public void setProviderUrl(java.lang.String providerUrl)
Set the Context.PROVIDER_URL of the JNDI Context used to fetch the XAConnectionFactory.

Parameters:
providerUrl - the Context.PROVIDER_URL value.

getUrlPkgPrefixes

public java.lang.String getUrlPkgPrefixes()
The Context.URL_PKG_PREFIXES of the JNDI Context used to fetch the XAConnectionFactory.

Returns:
the Context.URL_PKG_PREFIXES value.

setUrlPkgPrefixes

public void setUrlPkgPrefixes(java.lang.String urlPkgPrefixes)
Set the Context.URL_PKG_PREFIXES of the JNDI Context used to fetch the XAConnectionFactory.

Parameters:
urlPkgPrefixes - the Context.URL_PKG_PREFIXES value.

getSecurityPrincipal

public java.lang.String getSecurityPrincipal()
The Context.SECURITY_PRINCIPAL of the JNDI Context used to fetch the XAConnectionFactory.

Returns:
the Context.SECURITY_PRINCIPAL value.

setSecurityPrincipal

public void setSecurityPrincipal(java.lang.String securityPrincipal)
Set the Context.SECURITY_PRINCIPAL of the JNDI Context used to fetch the XAConnectionFactory. If Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL are not set, this value is ignored.

Parameters:
securityPrincipal - the Context.SECURITY_PRINCIPAL value.

getSecurityCredentials

public java.lang.String getSecurityCredentials()
The Context.SECURITY_CREDENTIALS of the JNDI Context used to fetch the XAConnectionFactory.

Returns:
the Context.SECURITY_CREDENTIALS value.

setSecurityCredentials

public void setSecurityCredentials(java.lang.String securityCredentials)
Set the Context.SECURITY_CREDENTIALS of the JNDI Context used to fetch the XAConnectionFactory. If Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL are not set, this value is ignored.

Parameters:
securityCredentials - the Context.SECURITY_CREDENTIALS value.

getName

public java.lang.String getName()
The JNDI name under which the XAConnectionFactory is available.

Returns:
The JNDI name.

setName

public void setName(java.lang.String name)
Set the JNDI name under which the XAConnectionFactory is available.

Parameters:
name - the JNDI name.

getExtraJndiProperties

public java.util.Properties getExtraJndiProperties()
The extra JNDI environment properties added the the InitialContext's environment upon creation.

Returns:
The extra JNDI environment properties.

setExtraJndiProperties

public void setExtraJndiProperties(java.util.Properties extraJndiProperties)
Set the extra JNDI environment properties added the the InitialContext's environment upon creation.

Parameters:
extraJndiProperties - The extra JNDI environment properties.

isNarrowJndiObject

public boolean isNarrowJndiObject()
Should PortableRemoteObject.narrow(Object, Class) be applied on the object looked up from JNDI before trying to cast it to XAConnectionFactory ?

Returns:
true if the object should be narrowed, false otherwise.

setNarrowJndiObject

public void setNarrowJndiObject(boolean narrowJndiObject)
Set if PortableRemoteObject.narrow(Object, Class) should be applied on the object looked up from JNDI before trying to cast it to XAConnectionFactory ?

Parameters:
narrowJndiObject - true if the object should be narrowed, false otherwise.

init

protected void init()
             throws javax.naming.NamingException
Throws:
javax.naming.NamingException

createXAConnection

public javax.jms.XAConnection createXAConnection()
                                          throws javax.jms.JMSException
Specified by:
createXAConnection in interface javax.jms.XAConnectionFactory
Throws:
javax.jms.JMSException

createXAConnection

public javax.jms.XAConnection createXAConnection(java.lang.String userName,
                                                 java.lang.String password)
                                          throws javax.jms.JMSException
Specified by:
createXAConnection in interface javax.jms.XAConnectionFactory
Throws:
javax.jms.JMSException