org.apache.oozie.jms
Interface ConnectionContext

All Known Implementing Classes:
DefaultConnectionContext

public interface ConnectionContext

Maintains a JMS connection for creating session, consumer and producer


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
 

Method Detail

createConnection

void createConnection(Properties props)
                      throws NamingException,
                             javax.jms.JMSException
Create connection using properties

Parameters:
props - the properties used for creating jndi context
Throws:
javax.jms.JMSException
NamingException

setExceptionListener

void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
                          throws javax.jms.JMSException
Set the exception Listener

Parameters:
exceptionListener -
Throws:
javax.jms.JMSException

isConnectionInitialized

boolean isConnectionInitialized()
Checks whether connection is initialized or not

Returns:

createSession

javax.jms.Session createSession(int sessionOpts)
                                throws javax.jms.JMSException
Creates session using the specified session opts

Parameters:
sessionOpts -
Returns:
Throws:
javax.jms.JMSException

createConsumer

javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
                                         String topicName)
                                         throws javax.jms.JMSException
Creates consumer using session and topic name

Parameters:
session -
topicName -
Returns:
Throws:
javax.jms.JMSException

createConsumer

javax.jms.MessageConsumer createConsumer(javax.jms.Session session,
                                         String topicName,
                                         String selector)
                                         throws javax.jms.JMSException
Creates consumer using session, topic name and selector

Parameters:
session -
topicName -
Returns:
Throws:
javax.jms.JMSException

createProducer

javax.jms.MessageProducer createProducer(javax.jms.Session session,
                                         String topicName)
                                         throws javax.jms.JMSException
Creates producer using session and topic

Parameters:
session -
topicName -
Returns:
Throws:
javax.jms.JMSException

createThreadLocalSession

javax.jms.Session createThreadLocalSession(int sessionOpts)
                                           throws javax.jms.JMSException
Creates a threadlocal session using session opts

Parameters:
session -
topicName -
Returns:
Throws:
javax.jms.JMSException

close

void close()
Closes the connection



Copyright © 2013 Apache Software Foundation. All Rights Reserved.