org.apache.commons.messagelet
Class SubscriptionManager

java.lang.Object
  extended by org.apache.commons.messagelet.SubscriptionManager

public class SubscriptionManager
extends java.lang.Object

SubscriptionManager is a simple command line program that will create a number of subscriptions and consume messages using just regular MDO and MessageListener classes.

Version:
$Revision: 1.3 $
Author:
James Strachan

Field Summary
private static org.apache.commons.logging.Log log
          Logger
private  MessengerManager manager
          The JMS connections
private  javax.servlet.ServletContext servletContext
          The context passed into MDOs
private  SubscriptionList subscriptionList
          The JMS Subscriptions
private  boolean useStopWatch
          Should we use a stopwatch to output performance metrics
 
Constructor Summary
SubscriptionManager()
           
 
Method Summary
protected  Messenger getMessenger(java.lang.String name)
           
 MessengerManager getMessengerManager()
           
 javax.servlet.ServletContext getServletContext()
          Returns the servletContext.
 SubscriptionList getSubscriptionList()
          Returns the subscriptionList.
 void setMessengerManager(MessengerManager manager)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
          Sets the servletContext.
 void setSubscriptionList(SubscriptionList subscriptionList)
          Sets the subscriptionList.
protected  void subscribe()
           
 void subscribe(Subscription subscription)
           
 void unsubscribe()
           
 void unsubscribe(Subscription subscription)
           
protected  javax.jms.MessageListener wrapInStopWatch(javax.jms.MessageListener listener)
          Allows the MessageListener to be wrapped inside a stop watch message listener if required
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Logger


manager

private MessengerManager manager
The JMS connections


subscriptionList

private SubscriptionList subscriptionList
The JMS Subscriptions


servletContext

private javax.servlet.ServletContext servletContext
The context passed into MDOs


useStopWatch

private boolean useStopWatch
Should we use a stopwatch to output performance metrics

Constructor Detail

SubscriptionManager

public SubscriptionManager()
Method Detail

subscribe

protected void subscribe()
                  throws javax.jms.JMSException,
                         javax.servlet.ServletException
Throws:
javax.jms.JMSException
javax.servlet.ServletException

subscribe

public void subscribe(Subscription subscription)
               throws javax.jms.JMSException,
                      javax.servlet.ServletException
Throws:
javax.jms.JMSException
javax.servlet.ServletException

unsubscribe

public void unsubscribe()
                 throws javax.jms.JMSException,
                        javax.servlet.ServletException
Throws:
javax.jms.JMSException
javax.servlet.ServletException

unsubscribe

public void unsubscribe(Subscription subscription)
                 throws javax.jms.JMSException,
                        javax.servlet.ServletException
Throws:
javax.jms.JMSException
javax.servlet.ServletException

getMessengerManager

public MessengerManager getMessengerManager()
                                     throws javax.jms.JMSException
Throws:
javax.jms.JMSException

setMessengerManager

public void setMessengerManager(MessengerManager manager)

getSubscriptionList

public SubscriptionList getSubscriptionList()
Returns the subscriptionList.

Returns:
SubscriptionList

setSubscriptionList

public void setSubscriptionList(SubscriptionList subscriptionList)
Sets the subscriptionList.

Parameters:
subscriptionList - The subscriptionList to set

getServletContext

public javax.servlet.ServletContext getServletContext()
Returns the servletContext.

Returns:
ServletContext

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Sets the servletContext.

Parameters:
servletContext - The servletContext to set

wrapInStopWatch

protected javax.jms.MessageListener wrapInStopWatch(javax.jms.MessageListener listener)
Allows the MessageListener to be wrapped inside a stop watch message listener if required


getMessenger

protected Messenger getMessenger(java.lang.String name)
                          throws javax.jms.JMSException
Throws:
javax.jms.JMSException