org.apache.tuscany.sca.binding.jms.provider
Class JMSResourceFactoryImpl

java.lang.Object
  extended by org.apache.tuscany.sca.binding.jms.provider.JMSResourceFactoryImpl
All Implemented Interfaces:
JMSResourceFactory
Direct Known Subclasses:
AMQJMSResourceFactory

public class JMSResourceFactoryImpl
extends java.lang.Object
implements JMSResourceFactory

Abstracts away any JMS provide specific feature from the JMS binding


Field Summary
protected  Connection connection
           
protected  java.lang.String connectionFactoryName
           
protected  javax.naming.Context context
           
protected  java.lang.String initialContextFactoryName
           
protected  boolean isConnectionStarted
           
protected  java.lang.String jndiURL
           
 
Constructor Summary
JMSResourceFactoryImpl(java.lang.String connectionFactoryName, java.lang.String initialContextFactoryName, java.lang.String jndiURL)
           
 
Method Summary
 void closeConnection()
           
protected  void createConnection()
           
 Destination createDestination(java.lang.String jndiName)
          You can create a destination in ActiveMQ (and have it appear in JNDI) by putting "dynamicQueues/" in front of the queue name being looked up
 Session createSession()
           
 Connection getConnection()
           
protected  javax.naming.Context getInitialContext()
           
protected  void initJREEnvironment(java.util.Properties props)
          If using the WAS JMS Client with a non-IBM JRE then an additional environment property needs to be set to initialize the ORB correctly.
protected  java.lang.Object jndiLookUp(java.lang.String name)
           
 Destination lookupDestination(java.lang.String destName)
           
protected  Destination lookupPhysical(java.lang.String jndiName)
           
 void startConnection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initialContextFactoryName

protected java.lang.String initialContextFactoryName

connectionFactoryName

protected java.lang.String connectionFactoryName

jndiURL

protected java.lang.String jndiURL

connection

protected Connection connection

context

protected javax.naming.Context context

isConnectionStarted

protected boolean isConnectionStarted
Constructor Detail

JMSResourceFactoryImpl

public JMSResourceFactoryImpl(java.lang.String connectionFactoryName,
                              java.lang.String initialContextFactoryName,
                              java.lang.String jndiURL)
Method Detail

getConnection

public Connection getConnection()
                         throws javax.naming.NamingException,
                                JMSException
Specified by:
getConnection in interface JMSResourceFactory
Throws:
javax.naming.NamingException
JMSException

createSession

public Session createSession()
                      throws JMSException,
                             javax.naming.NamingException
Specified by:
createSession in interface JMSResourceFactory
Throws:
JMSException
javax.naming.NamingException

startConnection

public void startConnection()
                     throws JMSException,
                            javax.naming.NamingException
Specified by:
startConnection in interface JMSResourceFactory
Throws:
JMSException
javax.naming.NamingException

closeConnection

public void closeConnection()
                     throws JMSException
Specified by:
closeConnection in interface JMSResourceFactory
Throws:
JMSException

createConnection

protected void createConnection()
                         throws javax.naming.NamingException,
                                JMSException
Throws:
javax.naming.NamingException
JMSException

getInitialContext

protected javax.naming.Context getInitialContext()
                                          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

initJREEnvironment

protected void initJREEnvironment(java.util.Properties props)
If using the WAS JMS Client with a non-IBM JRE then an additional environment property needs to be set to initialize the ORB correctly. See: http://www-1.ibm.com/support/docview.wss?uid=swg24012804


lookupDestination

public Destination lookupDestination(java.lang.String destName)
                              throws javax.naming.NamingException
Specified by:
lookupDestination in interface JMSResourceFactory
Throws:
javax.naming.NamingException

lookupPhysical

protected Destination lookupPhysical(java.lang.String jndiName)

createDestination

public Destination createDestination(java.lang.String jndiName)
                              throws javax.naming.NamingException
Description copied from interface: JMSResourceFactory
You can create a destination in ActiveMQ (and have it appear in JNDI) by putting "dynamicQueues/" in front of the queue name being looked up

Specified by:
createDestination in interface JMSResourceFactory
Throws:
javax.naming.NamingException

jndiLookUp

protected java.lang.Object jndiLookUp(java.lang.String name)