Package com.adaptris.xa.jms
Class XAJmsConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.core.AllowsRetriesConnection
-
- com.adaptris.xa.jms.XAJmsConnection
-
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,ConnectionComparator<XAJmsConnection>,JmsConnectionConfig,StateManagedComponent,XAJmsConnectionConfig
@ComponentProfile(summary="Connect to a JMS 1.1 broker using XA transactions", tag="connections,jms,xa") public class XAJmsConnection extends AllowsRetriesConnection implements XAJmsConnectionConfig, ConnectionComparator<XAJmsConnection>JMS 1.1 standard XA JMS connection.In the adapter configuration file this class is aliased as xa-jms-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.jms.XAConnectionconnection-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description XAJmsConnection()Create a new instance.XAJmsConnection(XAVendorImplementation impl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanadditionalDebug()protected voidcloseConnection()java.lang.StringconfiguredClientId()java.lang.StringconfiguredPassword()java.lang.StringconfiguredUserName()XAVendorImplementationconfiguredVendorImplementation()booleanconnectionEquals(XAJmsConnection connection)protected voidcreateConnection(javax.jms.XAConnectionFactory factory)javax.jms.XASessioncreateXASession()Creates a newSessionon the underlying JMSConnection.javax.jms.XAConnectioncurrentConnection()java.lang.BooleangetAdditionalDebug()java.lang.StringgetBrokerDetailsForLogging()java.lang.StringgetClientId()Sets the broker connection client ID.java.lang.StringgetPassword()Sets the broker password.java.lang.StringgetUserName()Returns the broker user name.XAVendorImplementationgetVendorImplementation()Sets theVendorImplementationto use.protected voidinitConnection()javax.jms.XAConnectionFactoryobtainConnectionFactory()protected voidprepareConnection()voidsetAdditionalDebug(java.lang.Boolean b)Whether or not to generate additional TRACE level debug when attempting connections.voidsetClientId(java.lang.String s)Returns the broker connection client ID.voidsetPassword(java.lang.String s)Sets the broker password.voidsetUserName(java.lang.String s)Sets the broker user name.voidsetVendorImplementation(XAVendorImplementation imp)Returns theVendorImplementationto use.protected voidstartConnection()protected voidstopConnection()-
Methods inherited from class com.adaptris.core.AllowsRetriesConnection
connectionAttempts, connectionRetryInterval, createLoggingStatement, getConnectionAttempts, getConnectionRetryInterval, logWarning, setConnectionAttempts, setConnectionRetryInterval
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Constructor Detail
-
XAJmsConnection
public XAJmsConnection()
Create a new instance. Default settings are:
- vendor-implementation - StandardJndiImplementation
- username - "" (i.e. blank)
-
XAJmsConnection
public XAJmsConnection(XAVendorImplementation impl)
-
-
Method Detail
-
initConnection
protected void initConnection() throws CoreException- Specified by:
initConnectionin classAdaptrisConnectionImp- Throws:
CoreException- See Also:
AdaptrisConnectionImp.initConnection()
-
currentConnection
public javax.jms.XAConnection currentConnection()
-
startConnection
protected void startConnection() throws CoreException- Specified by:
startConnectionin classAdaptrisConnectionImp- Throws:
CoreException- See Also:
AdaptrisConnectionImp.startConnection()
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnectionin classAdaptrisConnectionImp- See Also:
AdaptrisConnectionImp.stopConnection()
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnectionin classAdaptrisConnectionImp- See Also:
AdaptrisConnectionImp.closeConnection()
-
createXASession
public javax.jms.XASession createXASession() throws javax.jms.JMSExceptionCreates a new
Sessionon the underlying JMSConnection.- Returns:
- a new
XASession - Throws:
javax.jms.JMSException- if any occurs
-
obtainConnectionFactory
public javax.jms.XAConnectionFactory obtainConnectionFactory() throws java.lang.Exception- Throws:
java.lang.Exception
-
getBrokerDetailsForLogging
public java.lang.String getBrokerDetailsForLogging()
-
createConnection
protected void createConnection(javax.jms.XAConnectionFactory factory) throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
prepareConnection
protected void prepareConnection() throws CoreException- Specified by:
prepareConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
connectionEquals
public boolean connectionEquals(XAJmsConnection connection)
- Specified by:
connectionEqualsin interfaceConnectionComparator<XAJmsConnection>
-
getUserName
public java.lang.String getUserName()
Returns the broker user name.
- Returns:
- the broker user name
-
setUserName
public void setUserName(java.lang.String s)
Sets the broker user name.
- Parameters:
s- the broker user name
-
getPassword
public java.lang.String getPassword()
Sets the broker password.
- Returns:
- the broker password
-
setPassword
public void setPassword(java.lang.String s)
Sets the broker password.
In additional to plain text passwords, the passwords can also be encoded using the appropriate
Password- Parameters:
s- the broker password
-
getClientId
public java.lang.String getClientId()
Sets the broker connection client ID.
- Returns:
- the broker connection client ID
-
setClientId
public void setClientId(java.lang.String s)
Returns the broker connection client ID.
- Parameters:
s- the broker connection client ID
-
getVendorImplementation
public XAVendorImplementation getVendorImplementation()
Sets the
VendorImplementationto use.- Returns:
- the
VendorImplementationto use
-
setVendorImplementation
public void setVendorImplementation(XAVendorImplementation imp)
Returns the
VendorImplementationto use.- Parameters:
imp- theVendorImplementationto use
-
getAdditionalDebug
public java.lang.Boolean getAdditionalDebug()
-
setAdditionalDebug
public void setAdditionalDebug(java.lang.Boolean b)
Whether or not to generate additional TRACE level debug when attempting connections.- Parameters:
b- true to enable additional logging; default false.
-
additionalDebug
protected boolean additionalDebug()
-
configuredClientId
public java.lang.String configuredClientId()
- Specified by:
configuredClientIdin interfaceJmsConnectionConfig
-
configuredPassword
public java.lang.String configuredPassword()
- Specified by:
configuredPasswordin interfaceJmsConnectionConfig
-
configuredUserName
public java.lang.String configuredUserName()
- Specified by:
configuredUserNamein interfaceJmsConnectionConfig
-
configuredVendorImplementation
public XAVendorImplementation configuredVendorImplementation()
- Specified by:
configuredVendorImplementationin interfaceJmsConnectionConfig
-
-