org.apache.cactus.internal.client.jms
Class JmsClientHelper

java.lang.Object
  extended by org.apache.cactus.internal.client.jms.JmsClientHelper

public class JmsClientHelper
extends java.lang.Object

Helper class to send a JMS message.

Since:
1.4
Version:
$Id$
Author:
Vincent Massol

Constructor Summary
JmsClientHelper()
           
 
Method Summary
protected static javax.jms.QueueConnection createQueueConnection()
          Create a JMS Queue Connection to be able to send messages later on.
static javax.jms.QueueSender createQueueSender(java.lang.String theQueueName)
          Creates a Queue Sender to send JMS messages.
static javax.naming.InitialContext getInitialContext()
           
static javax.jms.Queue getQueue(java.lang.String theQueueName)
          Lookup a queue in JNDI.
static javax.jms.QueueConnectionFactory getQueueConnnectionFactory()
           
static javax.jms.QueueSession getQueueSession()
          Return the Queue session that we will use to send all JMS messages (the Session is created if it is the first time this method is called).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsClientHelper

public JmsClientHelper()
Method Detail

createQueueConnection

protected static javax.jms.QueueConnection createQueueConnection()
                                                          throws javax.jms.JMSException
Create a JMS Queue Connection to be able to send messages later on.

Returns:
the created queue connection
Throws:
javax.jms.JMSException - if an error occurred

getQueueSession

public static javax.jms.QueueSession getQueueSession()
Return the Queue session that we will use to send all JMS messages (the Session is created if it is the first time this method is called).

Returns:
the created Queue Session

getInitialContext

public static javax.naming.InitialContext getInitialContext()
Returns:
the JNDI Initial Context as defined in the Cactus configuration file (used to retrieve the JMS Queue Connection Factory)

getQueueConnnectionFactory

public static javax.jms.QueueConnectionFactory getQueueConnnectionFactory()
Returns:
the JMS Queue Connection Factory from which to retrieve Queues

getQueue

public static javax.jms.Queue getQueue(java.lang.String theQueueName)
Lookup a queue in JNDI.

Parameters:
theQueueName - the JNDI name of the queue to look up
Returns:
the queue object

createQueueSender

public static javax.jms.QueueSender createQueueSender(java.lang.String theQueueName)
Creates a Queue Sender to send JMS messages.

Parameters:
theQueueName - the JNDI name of the queue to use to send messages
Returns:
the queue sender object


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