public class DefaultConnectionContext extends Object implements ConnectionContext
| Modifier and Type | Field and Description |
|---|---|
protected javax.jms.Connection |
connection |
protected String |
connectionFactoryName |
| Constructor and Description |
|---|
DefaultConnectionContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection
|
void |
createConnection(Properties props)
Create connection using properties
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
String topicName)
Creates consumer using session and topic name
|
javax.jms.MessageConsumer |
createConsumer(javax.jms.Session session,
String topicName,
String selector)
Creates consumer using session, topic name and selector
|
javax.jms.MessageProducer |
createProducer(javax.jms.Session session,
String topicName)
Creates producer using session and topic
|
javax.jms.Session |
createSession(int sessionOpts)
Creates session using the specified session opts
|
javax.jms.Session |
createThreadLocalSession(int sessionOpts)
Creates a threadlocal session using session opts
|
boolean |
isConnectionInitialized()
Checks whether connection is initialized or not
|
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener)
Set the exception Listener
|
protected javax.jms.Connection connection
protected String connectionFactoryName
public DefaultConnectionContext()
public void createConnection(Properties props) throws NamingException, javax.jms.JMSException
ConnectionContextcreateConnection in interface ConnectionContextprops - the properties used for creating jndi contextjavax.jms.JMSExceptionNamingExceptionpublic boolean isConnectionInitialized()
ConnectionContextisConnectionInitialized in interface ConnectionContextpublic void setExceptionListener(javax.jms.ExceptionListener exceptionListener) throws javax.jms.JMSException
ConnectionContextsetExceptionListener in interface ConnectionContextjavax.jms.JMSExceptionpublic javax.jms.Session createSession(int sessionOpts) throws javax.jms.JMSException
ConnectionContextcreateSession in interface ConnectionContextjavax.jms.JMSExceptionpublic javax.jms.MessageConsumer createConsumer(javax.jms.Session session, String topicName) throws javax.jms.JMSException
ConnectionContextcreateConsumer in interface ConnectionContextjavax.jms.JMSExceptionpublic javax.jms.MessageProducer createProducer(javax.jms.Session session, String topicName) throws javax.jms.JMSException
ConnectionContextcreateProducer in interface ConnectionContextjavax.jms.JMSExceptionpublic void close()
ConnectionContextclose in interface ConnectionContextpublic javax.jms.Session createThreadLocalSession(int sessionOpts) throws javax.jms.JMSException
ConnectionContextcreateThreadLocalSession in interface ConnectionContextjavax.jms.JMSExceptionpublic javax.jms.MessageConsumer createConsumer(javax.jms.Session session, String topicName, String selector) throws javax.jms.JMSException
ConnectionContextcreateConsumer in interface ConnectionContextjavax.jms.JMSExceptionCopyright © 2015 Apache Software Foundation. All Rights Reserved.