KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > tags > DestroyQueryTag


1 package com.tonbeller.jpivot.tags;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6 import org.apache.log4j.Logger;
7
8 /**
9  * destroys all instances stored with this id
10  * @author av
11  * @since 16.02.2005
12  */

13 public class DestroyQueryTag extends TagSupport JavaDoc {
14   private static final Logger logger = Logger.getLogger(DestroyQueryTag.class);
15   String JavaDoc queryName;
16   
17   public int doStartTag() throws JspException JavaDoc {
18     OlapModelProxy omp = OlapModelProxy.instance(id, pageContext.getSession());
19     try {
20       if (queryName == null)
21         omp.destroyAll();
22       else
23         omp.destroyQuery(queryName);
24     } catch (Exception JavaDoc e) {
25       logger.error(null, e);
26       throw new JspException JavaDoc(e);
27     }
28     return super.doStartTag();
29   }
30   
31   public void setQueryName(String JavaDoc queryName) {
32     this.queryName = queryName;
33   }
34 }
35
Popular Tags