org.apache.commons.messenger
Class JNDISessionFactory

java.lang.Object
  extended by org.apache.commons.messenger.SessionFactory
      extended by org.apache.commons.messenger.JNDISessionFactory

public class JNDISessionFactory
extends SessionFactory

JNDISessionFactory is a Factory of JMS Session objects which looks up the ConnectionFactory object from JNDI.

Version:
$Revision: 155459 $
Author:
James Strachan

Field Summary
 Context context
          the initial JNDI context used to lookup ConnectionFactory objects
 
Fields inherited from class org.apache.commons.messenger.SessionFactory
properties
 
Constructor Summary
JNDISessionFactory()
           
 
Method Summary
 javax.jms.Connection createConnection()
          Re-implemented from SessionFactory.
protected  javax.jms.ConnectionFactory createConnectionFactory()
          Factory method used to create a connection factory.
protected  Context createContext()
          Factory method used to create a connection factory.
 javax.jms.Session createSession(javax.jms.Connection connection)
          Re-implemented from SessionFactory.
 Context getContext()
          Returns the JNDI Context used to lookup JMS ConnectionFactory objects
 String getLookupName()
          The JNDI Name of the ConnectionFactory
 void setContext(Context context)
           
 void setLookupName(String lookupName)
          Sets the JNDI Name of the ConnectionFactory
 
Methods inherited from class org.apache.commons.messenger.SessionFactory
addProperty, close, createProperties, createQueueConnection, createServerSessionPool, createSession, createTopicConnection, getAcknowledgeMode, getClientID, getConnection, getConnectionFactory, getPassword, getProperties, getUsername, isTopic, isTransacted, setAcknowledge, setAcknowledgeMode, setClientID, setConnection, setConnectionFactory, setPassword, setProperties, setTopic, setTransacted, setUsername
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

public Context context
the initial JNDI context used to lookup ConnectionFactory objects

Constructor Detail

JNDISessionFactory

public JNDISessionFactory()
Method Detail

getLookupName

public String getLookupName()
The JNDI Name of the ConnectionFactory


setLookupName

public void setLookupName(String lookupName)
Sets the JNDI Name of the ConnectionFactory


getContext

public Context getContext()
                   throws NamingException
Returns the JNDI Context used to lookup JMS ConnectionFactory objects

Throws:
NamingException

setContext

public void setContext(Context context)

createConnectionFactory

protected javax.jms.ConnectionFactory createConnectionFactory()
                                                       throws javax.jms.JMSException
Factory method used to create a connection factory. Lookup the ConnectionFactory in JNDI

Overrides:
createConnectionFactory in class SessionFactory
Throws:
javax.jms.JMSException

createConnection

public javax.jms.Connection createConnection()
                                      throws javax.jms.JMSException
Re-implemented from SessionFactory. Method used to create a connection

Overrides:
createConnection in class SessionFactory
Throws:
javax.jms.JMSException

createSession

public javax.jms.Session createSession(javax.jms.Connection connection)
                                throws javax.jms.JMSException
Re-implemented from SessionFactory. Creates a new Session instance

Overrides:
createSession in class SessionFactory
Throws:
javax.jms.JMSException

createContext

protected Context createContext()
                         throws NamingException
Factory method used to create a connection factory. Derived classes may wish to use JNDI to load the ConnectionFactory

Throws:
NamingException


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.