package javax.servlet.jsp.tagext;

import javax.servlet.jsp.JspException;

/** Represents a Tag which is callable by other tags.
  * This means that other tags can explicitly cause the this tag to
  * generate its body on demand.
  * Usually the other tags will be an outer tags that this RunnableTag has
  * registered with via some type-specific mechanism.
  */
public interface RunnableTag extends Tag {

    /** Called once after the tag is initialised allowing it
      * to register with an outer tag 
      */
    public void doRegister() throws JspException;
    
    /** Executes this tag's body, outputting the body to the 
      * PageContext of this tag.
      * This will use the tags internal TagRunner object to call a 
      * function in the servlet instance that this thread is running.
      * A JSP compiler can do this in a number of ways such as
      * using inner classes or using reflection
      */
    public void run() throws JspException;


    /** Called by the code generated by the JSP compiler to
      * pass in the object which is capable of running the body
      * of the tag
      */
    public void setTagRunner( TagRunner tagRunner );
}

