org.apache.commons.messenger.tool
Class StopWatchMessageListener

java.lang.Object
  extended by org.apache.commons.messenger.tool.StopWatchMessageListener
All Implemented Interfaces:
javax.jms.MessageListener

public class StopWatchMessageListener
extends Object
implements javax.jms.MessageListener

A simple StopWatch Message Listener for wrapping another MessageListener to determine its performance.

Author:
James Strachan

Constructor Summary
StopWatchMessageListener()
           
StopWatchMessageListener(javax.jms.MessageListener messageListener)
           
 
Method Summary
 int getGroupSize()
           
 org.apache.commons.logging.Log getLog()
           
 javax.jms.MessageListener getMessageListener()
           
 void onMessage(javax.jms.Message message)
           
 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 MessageListener which this listener delegates to, which can be null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatchMessageListener

public StopWatchMessageListener()

StopWatchMessageListener

public StopWatchMessageListener(javax.jms.MessageListener messageListener)
Method Detail

onMessage

public void onMessage(javax.jms.Message message)
Specified by:
onMessage in interface javax.jms.MessageListener

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 MessageListener which this listener delegates to, which can be null.



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