org.mmbase.bridge.jsp.taglib.debug
Class TimerTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.debug.TimerTag
All Implemented Interfaces:
BodyTag, IterationTag, Serializable, Tag

public class TimerTag
extends ContextReferrerTag

Times how long the executing of the body took, and logs this. Child elements can also time theirselves, and appear in the 'total times' overview.

Version:
$Id: TimerTag.java,v 1.8 2004/06/30 17:51:55 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
TimerTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
          Initialize timer.
 long haltTimer(int handle)
          Stops the timer identified by the handle, and logs and returns the result in second.
 void setName(String n)
           
 int startTimer(String id)
           
 int startTimer(String id, String id2)
          Starts a timer.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
fillStandardParameters, findLoopOrQuery, findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getDefaultLocale, getEscapedValue, getId, getLocale, getObject, getObjectConditional, getPageContext, getPageContextTag, getReferid, getString, getTaglibVersion, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setListdelimiter, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Constructor Detail

TimerTag

public TimerTag()
Method Detail

setName

public void setName(String n)
             throws JspTagException
Throws:
JspTagException

startTimer

public int startTimer(String id,
                      String id2)
               throws JspTagException
Starts a timer.

Parameters:
id - An id which optionally can be null. Can e.g. be getId().
id2 - Another id which cannot be null. Something descriptive.
Returns:
an integer handle, which you need to remember to halt the timer.
Throws:
JspTagException

startTimer

public int startTimer(String id)
               throws JspTagException
Throws:
JspTagException

haltTimer

public long haltTimer(int handle)
               throws JspTagException
Stops the timer identified by the handle, and logs and returns the result in second.

Throws:
JspTagException

doStartTag

public int doStartTag()
               throws JspTagException
Initialize timer.

Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspTagException
Throws:
JspTagException

doEndTag

public int doEndTag()
             throws JspTagException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
JspTagException


MMBase build 1.8.1.20060716