public abstract class JMSClient
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
conFactoryName
The JNDI name of the ConnectionFactory.
|
protected javax.jms.Connection |
conn
The Connection handle obtained from the ConnectionFactory.
|
protected javax.jms.Destination |
destinationHandle
The javax.jms.Destination [Queue, Topic] for the JMS client
|
protected java.lang.String |
destinationName
The JNDI name of the javax.jms.Destination [Queue, Topic] to which the
client will connect.
|
protected java.lang.String |
destinationType
The type of Destination the client is connecting to.
|
protected java.util.Properties |
env
The env properties to get an InitialContext.
|
protected boolean |
isExternalSession
Indicates if its an externally owned Session or this JMS client owned
Session.
|
static java.lang.String |
JMS_LOGGER
The JMS logger.
|
protected static MXLogger |
jmsLogger
JMS Logger
|
static int |
NO_TX
Setting this mode will result in non transacted JMS client Session.
|
protected java.lang.String |
providerPassword |
protected java.lang.String |
providerUserName |
static java.lang.String |
QUEUE
Queue Destination type
|
protected javax.jms.Session |
session
The JMS client Session.
|
static int |
SESSION_TX
Setting this mode will result in transacted JMS client session.
|
static java.lang.String |
TOPIC
Topic Destination type
|
protected int |
txMode
The transaction mode for the JMS client Session.
|
protected boolean |
valid
Indicates if the JMS client is still having a live Session to the JMS
provider.
|
Modifier | Constructor and Description |
---|---|
protected |
JMSClient(java.lang.String destinationName,
java.lang.String conFactoryName,
int txMode,
java.util.Properties env) |
protected |
JMSClient(java.lang.String destinationName,
java.lang.String conFactoryName,
int txMode,
java.util.Properties env,
java.lang.String providerUserName,
java.lang.String providerPassword) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releses all resources that is cached by the client like JMS Session and
Connection.
|
void |
commitTx()
Commits the JMS Session transaction.
|
abstract JMSClient |
createClientInSession()
Creates another JMSClient of the same type in this clients Session.
|
abstract JMSClient |
createClientInSession(java.lang.String destinationName,
java.util.Properties env)
Creates another JMSClient of the same type in this clients Session.
|
protected javax.jms.Connection |
createConnection(java.lang.String conFactoryJNDIName)
Create the JMS Connection from the configured ConnectionFactory.
|
protected void |
createSession(boolean transacted)
Creates a JMS Session.
|
java.lang.String |
getDestinationName() |
java.util.Properties |
getEnvironment() |
java.lang.String |
getProviderPassword() |
java.lang.String |
getProviderUserName() |
javax.jms.Session |
getSession()
Deprecated.
|
protected void |
invalidate()
Invalidates the jms client.
|
boolean |
isValid()
Determines if the client is still valid.
|
void |
rollbackTx()
Rollback the JMS Session transaction.
|
protected void |
setDestination()
Looks up the Destination from the JNDI tree.
|
public static final int NO_TX
public static final int SESSION_TX
public static final java.lang.String QUEUE
public static final java.lang.String TOPIC
protected java.lang.String destinationType
public static final java.lang.String JMS_LOGGER
protected java.lang.String providerUserName
protected java.lang.String providerPassword
protected int txMode
protected boolean valid
protected javax.jms.Session session
protected javax.jms.Connection conn
protected java.lang.String destinationName
protected javax.jms.Destination destinationHandle
protected java.lang.String conFactoryName
protected java.util.Properties env
protected boolean isExternalSession
protected static final MXLogger jmsLogger
protected JMSClient(java.lang.String destinationName, java.lang.String conFactoryName, int txMode, java.util.Properties env) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.txMode
- the Transaction mode - NO_TX[default] or SESSION_TXenv
- The env that would be used to create the IntialContext.MXException
protected JMSClient(java.lang.String destinationName, java.lang.String conFactoryName, int txMode, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) throws MXException
destinationName
- the JNDI name of the Destination.conFactoryName
- the JNDI name of the ConnectionFactory.txMode
- the Transaction mode - NO_TX[default] or SESSION_TXenv
- The env that would be used to create the IntialContext.providerUserName
- The provider connection user.providerPassword
- The provider connection password.MXException
protected void setDestination() throws javax.naming.NamingException
javax.naming.NamingException
public java.lang.String getProviderUserName()
public java.lang.String getProviderPassword()
@Deprecated public javax.jms.Session getSession()
public abstract JMSClient createClientInSession() throws MXException
MXException
public abstract JMSClient createClientInSession(java.lang.String destinationName, java.util.Properties env) throws MXException
MXException
public java.util.Properties getEnvironment()
public java.lang.String getDestinationName()
public boolean isValid()
public void close()
public void rollbackTx() throws MXException
MXException
public void commitTx() throws MXException
MXException
protected void invalidate()
javax.naming.NamingException
protected void createSession(boolean transacted) throws javax.naming.NamingException, javax.jms.JMSException
transacted
- indicates if the Session is transacted or not.javax.naming.NamingException
javax.jms.JMSException
protected javax.jms.Connection createConnection(java.lang.String conFactoryJNDIName) throws javax.naming.NamingException, javax.jms.JMSException
conFactoryJNDIName
- the JNDI name of the ConnectionFactory.javax.naming.NamingException
javax.jms.JMSException