Package org.apache.axis2.transport.jms
Class JMSConnectionFactory
- java.lang.Object
-
- org.apache.axis2.transport.jms.JMSConnectionFactory
-
public class JMSConnectionFactory extends 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
Constructors Constructor Description JMSConnectionFactory(Parameter parameter)
Digest a JMS CF definition from an axis2.xml 'Parameter' and construct
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCacheLevel()
Cache level applicable for this JMS CFjavax.jms.Connection
getConnection()
Get a new Connection or shared Connection from this JMS CFContext
getContext()
Get cached InitialContextjavax.jms.Destination
getDestination(String destinationName, String destinationType)
Lookup a Destination using this JMS CF definitions and JNDI namejavax.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 CFString
getName()
Return the name assigned to this JMS CF definitionHashtable<String,String>
getParameters()
The list of properties (including JNDI and non-JNDI)String
getReplyDestinationType()
Get the reply destination type from the PARAM_REPLY_DEST_TYPE parameterString
getReplyToDestination()
Get the reply Destination from the PARAM_REPLY_DESTINATION parameterjavax.jms.Session
getSession(javax.jms.Connection connection)
Get a new Session or shared Session from this JMS CFjavax.jms.Destination
getSharedDestination()
Get the shared Destination - if definedboolean
isJmsSpec11()
Should the JMS 1.1 API be used?Boolean
isQueue()
Return the type of the JMS CF Destinationvoid
stop()
Close all connections, sessions etc.. and stop this connection factory
-
-
-
Constructor Detail
-
JMSConnectionFactory
public JMSConnectionFactory(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
-
stop
public void stop()
Close all connections, sessions etc.. and stop this connection factory
-
getName
public String getName()
Return the name assigned to this JMS CF definition- Returns:
- name of the JMS CF
-
getParameters
public Hashtable<String,String> getParameters()
The list of properties (including JNDI and non-JNDI)- Returns:
- properties defined on the JMS CF
-
getContext
public 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(String destinationName, String destinationType)
Lookup a Destination using this JMS CF definitions and JNDI name- Parameters:
destinationName
- JNDI name of the DestionationdestinationType
- looking up destination type- Returns:
- JMS Destination for the given JNDI name or null
-
getReplyToDestination
public String getReplyToDestination()
Get the reply Destination from the PARAM_REPLY_DESTINATION parameter- Returns:
- reply destination defined in the JMS CF
-
getReplyDestinationType
public 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 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 usedsession
- the Session to be useddestination
- the Destination to bind MessageProducer to- Returns:
- new or shared MessageProducer from this JMS CF
-
-