org.apache.commons.jelly.tags.jms
Class StopwatchTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by org.apache.commons.jelly.tags.jms.MessageOperationTag
          extended by org.apache.commons.jelly.tags.jms.StopwatchTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag, ConnectionContext, ConsumerTag

public class StopwatchTag
extends MessageOperationTag
implements ConsumerTag

This tag can be used to measure the amount of time it takes to process JMS messages. This tag can be wrapped around any custom JMS tag which consumes JMS messages.

Version:
$Revision: 155420 $
Author:
James Strachan

Field Summary
private  int groupSize
          the message group size
private  org.apache.commons.logging.Log log
          The Log to which logging calls will be made.
private  javax.jms.MessageListener messageListener
          the underlying MessageListener
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
StopwatchTag()
           
 
Method Summary
 void doTag(org.apache.commons.jelly.XMLOutput output)
           
 int getGroupSize()
           
 org.apache.commons.logging.Log getLog()
           
 javax.jms.MessageListener getMessageListener()
           
 void setGroupSize(int groupSize)
          Sets the number of messages in the group before the performance statistics are logged
 void setLog(org.apache.commons.logging.Log log)
          Sets the logger to which statistic messages will be sent
 void setMessageListener(javax.jms.MessageListener messageListener)
          Sets the JMS messageListener used to consume JMS messages on the given destination
 
Methods inherited from class org.apache.commons.jelly.tags.jms.MessageOperationTag
findConnection, findDestination, getConnection, getDestination, setConnection, setDestination, setSubject
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageListener

private javax.jms.MessageListener messageListener
the underlying MessageListener


log

private org.apache.commons.logging.Log log
The Log to which logging calls will be made.


groupSize

private int groupSize
the message group size

Constructor Detail

StopwatchTag

public StopwatchTag()
Method Detail

doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
Specified by:
doTag in interface org.apache.commons.jelly.Tag
Throws:
org.apache.commons.jelly.JellyTagException

getGroupSize

public int getGroupSize()
Returns:
the number of messages in the group before the performance statistics are logged

setGroupSize

public void setGroupSize(int groupSize)
Sets the number of messages in the group before the performance statistics are logged


getLog

public org.apache.commons.logging.Log getLog()
Returns:
the logger to which statistic messages will be sent

setLog

public void setLog(org.apache.commons.logging.Log log)
Sets the logger to which statistic messages will be sent


getMessageListener

public javax.jms.MessageListener getMessageListener()
Returns:
the MessageListener which this listener delegates to

setMessageListener

public void setMessageListener(javax.jms.MessageListener messageListener)
Sets the JMS messageListener used to consume JMS messages on the given destination

Specified by:
setMessageListener in interface ConsumerTag