Class EtmMonitorContextListener

  extended by etm.contrib.integration.web.EtmMonitorContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class EtmMonitorContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

The EtmMonitorContextListener configures and starts an EtmMonitor using an XmlEtmConfigurator. By default it assumes a file called jetm-config.xml in classpath. You enable performance monitoring by adding this code fragement to your web.xml file.

It is possible to override the name of the file using the web app init parameter jetm.config.filename. Example:
As an alternative the jetm config file may be loaded from file system. This feature can be enabled by specifying jetm.config.filepath as context parameter. In the example below the jetm config file is expected at /etc/yourapp under the name supplied with jetm.config.filename. If jetm.config.filename is unset, the default name jetm-config.xml will be used.
While this feaure sounds convinient a hard coded filepath within a web.xml descriptor is often considered a design or programming error. Therefore the path to a jetm config file can be specified using a system property. Just write jetm.config.filepath as ant style property and its value will be retrieved from System.getProperty(String) using the given name. Example:


$Revision: 246 $

Constructor Summary
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
 void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public EtmMonitorContextListener()
Method Detail


public void contextInitialized(javax.servlet.ServletContextEvent servletContextEvent)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener


public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

Copyright © 2004,2005, 2006, 2007 All Rights Reserved.