org.apache.axis2.transport.jms
Class JMSConnectionFactory

java.lang.Object
  extended by org.apache.axis2.transport.jms.JMSConnectionFactory

public class JMSConnectionFactory
extends java.lang.Object

Encapsulate a JMS Connection factory definition within an Axis2.xml JMS Connection Factory definitions, allows JNDI properties as well as other service level parameters to be defined, and re-used by each service that binds to it When used for sending messages out, the JMSConnectionFactory'ies are able to cache a Connection, Session or Producer


Constructor Summary
JMSConnectionFactory(org.apache.axis2.description.Parameter parameter)
          Digest a JMS CF definition from an axis2.xml 'Parameter' and construct
 
Method Summary
 int getCacheLevel()
          Cache level applicable for this JMS CF
 javax.jms.Connection getConnection()
          Get a new Connection or shared Connection from this JMS CF
 javax.naming.Context getContext()
          Get cached InitialContext
 javax.jms.Destination getDestination(java.lang.String destinationName, java.lang.String destinationType)
          Lookup a Destination using this JMS CF definitions and JNDI name
 javax.jms.MessageProducer getMessageProducer(javax.jms.Connection connection, javax.jms.Session session, javax.jms.Destination destination)
          Get a new MessageProducer or shared MessageProducer from this JMS CF
 java.lang.String getName()
          Return the name assigned to this JMS CF definition
 java.util.Hashtable<java.lang.String,java.lang.String> getParameters()
          The list of properties (including JNDI and non-JNDI)
 java.lang.String getReplyDestinationType()
          Get the reply destination type from the PARAM_REPLY_DEST_TYPE parameter
 java.lang.String getReplyToDestination()
          Get the reply Destination from the PARAM_REPLY_DESTINATION parameter
 javax.jms.Session getSession(javax.jms.Connection connection)
          Get a new Session or shared Session from this JMS CF
 javax.jms.Destination getSharedDestination()
          Get the shared Destination - if defined
 boolean isJmsSpec11()
          Should the JMS 1.1 API be used? - defaults to yes
 java.lang.Boolean isQueue()
          Return the type of the JMS CF Destination
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSConnectionFactory

public JMSConnectionFactory(org.apache.axis2.description.Parameter parameter)
Digest a JMS CF definition from an axis2.xml 'Parameter' and construct

Parameters:
parameter - the axis2.xml 'Parameter' that defined the JMS CF
Method Detail

getName

public java.lang.String getName()
Return the name assigned to this JMS CF definition

Returns:
name of the JMS CF

getParameters

public java.util.Hashtable<java.lang.String,java.lang.String> getParameters()
The list of properties (including JNDI and non-JNDI)

Returns:
properties defined on the JMS CF

getContext

public javax.naming.Context getContext()
Get cached InitialContext

Returns:
cache InitialContext

getCacheLevel

public int getCacheLevel()
Cache level applicable for this JMS CF

Returns:
applicable cache level

getSharedDestination

public javax.jms.Destination getSharedDestination()
Get the shared Destination - if defined

Returns:

getDestination

public javax.jms.Destination getDestination(java.lang.String destinationName,
                                            java.lang.String destinationType)
Lookup a Destination using this JMS CF definitions and JNDI name

Parameters:
destinationName - JNDI name of the Destionation
destinationType - looking up destination type
Returns:
JMS Destination for the given JNDI name or null

getReplyToDestination

public java.lang.String getReplyToDestination()
Get the reply Destination from the PARAM_REPLY_DESTINATION parameter

Returns:
reply destination defined in the JMS CF

getReplyDestinationType

public java.lang.String getReplyDestinationType()
Get the reply destination type from the PARAM_REPLY_DEST_TYPE parameter

Returns:
reply destination defined in the JMS CF

isJmsSpec11

public boolean isJmsSpec11()
Should the JMS 1.1 API be used? - defaults to yes

Returns:
true, if JMS 1.1 api should be used

isQueue

public java.lang.Boolean isQueue()
Return the type of the JMS CF Destination

Returns:
TRUE if a Queue, FALSE for a Topic and NULL for a JMS 1.1 Generic Destination

getConnection

public javax.jms.Connection getConnection()
Get a new Connection or shared Connection from this JMS CF

Returns:
new or shared Connection from this JMS CF

getSession

public javax.jms.Session getSession(javax.jms.Connection connection)
Get a new Session or shared Session from this JMS CF

Parameters:
connection - the Connection to be used
Returns:
new or shared Session from this JMS CF

getMessageProducer

public javax.jms.MessageProducer getMessageProducer(javax.jms.Connection connection,
                                                    javax.jms.Session session,
                                                    javax.jms.Destination destination)
Get a new MessageProducer or shared MessageProducer from this JMS CF

Parameters:
connection - the Connection to be used
session - the Session to be used
destination - the Destination to bind MessageProducer to
Returns:
new or shared MessageProducer from this JMS CF


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.