org.apache.oozie.jms
Class DefaultConnectionContext

java.lang.Object
  extended by org.apache.oozie.jms.DefaultConnectionContext
All Implemented Interfaces:
ConnectionContext

public class DefaultConnectionContext
extends Object
implements ConnectionContext


Field Summary
protected  javax.jms.Connection connection
           
protected  String connectionFactoryName
           
 
Constructor Summary
DefaultConnectionContext()
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

protected javax.jms.Connection connection

connectionFactoryName

protected String connectionFactoryName
Constructor Detail

DefaultConnectionContext

public DefaultConnectionContext()
Method Detail

createConnection

public void createConnection(Properties props)
                      throws NamingException,
                             javax.jms.JMSException
Description copied from interface: ConnectionContext
Create connection using properties

Specified by:
createConnection in interface ConnectionContext
Parameters:
props - the properties used for creating jndi context
Throws:
javax.jms.JMSException
NamingException

isConnectionInitialized

public boolean isConnectionInitialized()
Description copied from interface: ConnectionContext
Checks whether connection is initialized or not

Specified by:
isConnectionInitialized in interface ConnectionContext
Returns:

setExceptionListener

public void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
                          throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Set the exception Listener

Specified by:
setExceptionListener in interface ConnectionContext
Throws:
javax.jms.JMSException

createSession

public javax.jms.Session createSession(int sessionOpts)
                                throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Creates session using the specified session opts

Specified by:
createSession in interface ConnectionContext
Returns:
Throws:
javax.jms.JMSException

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
                                                String topicName)
                                         throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Creates consumer using session and topic name

Specified by:
createConsumer in interface ConnectionContext
Returns:
Throws:
javax.jms.JMSException

createProducer

public javax.jms.MessageProducer createProducer(javax.jms.Session session,
                                                String topicName)
                                         throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Creates producer using session and topic

Specified by:
createProducer in interface ConnectionContext
Returns:
Throws:
javax.jms.JMSException

close

public void close()
Description copied from interface: ConnectionContext
Closes the connection

Specified by:
close in interface ConnectionContext

createThreadLocalSession

public javax.jms.Session createThreadLocalSession(int sessionOpts)
                                           throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Creates a threadlocal session using session opts

Specified by:
createThreadLocalSession in interface ConnectionContext
Returns:
Throws:
javax.jms.JMSException

createConsumer

public javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
                                                String topicName,
                                                String selector)
                                         throws javax.jms.JMSException
Description copied from interface: ConnectionContext
Creates consumer using session, topic name and selector

Specified by:
createConsumer in interface ConnectionContext
Returns:
Throws:
javax.jms.JMSException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.