Coverage Report - org.apache.commons.cache.tagext.ClearCacheTag
 
Classes in this File Line Coverage Branch Coverage Complexity
ClearCacheTag
0%
0/24
0%
0/4
1.286
 
 1  
 /*
 2  
  * Copyright 2001-2004 The Apache Software Foundation
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.apache.commons.cache.tagext;
 17  
 
 18  
 import javax.servlet.jsp.JspTagException;
 19  
 import javax.servlet.jsp.JspException;
 20  
 import javax.servlet.jsp.tagext.TagSupport;
 21  
 import java.io.Serializable;
 22  
 
 23  
 /**
 24  
  * tk.
 25  
  * @version $Id: ClearCacheTag.java 155435 2005-02-26 13:17:27Z dirkv $
 26  
  * @author Rodney Waldhoff
 27  
  */
 28  
 public class ClearCacheTag extends TagSupport {
 29  
 
 30  0
   protected Serializable _key = null;
 31  0
   protected Serializable _group = null;
 32  0
   protected String _name = null;
 33  
 
 34  
   public void setName(String name) {
 35  0
      _name = name;
 36  0
   }
 37  
 
 38  
   public void setKey(String key) {
 39  0
     _key = key;
 40  0
   }
 41  
 
 42  
 // weblogic reflection doesn't work very well
 43  
 /*
 44  
   public void setKey(Serializable key) {
 45  
     _key = key;
 46  
   }
 47  
 */
 48  
   public void setGroup(String group) {
 49  0
     _group = group;
 50  0
   }
 51  
 
 52  
 // weblogic reflection doesn't work very well
 53  
 /*
 54  
   public void setGroup(Serializable group) {
 55  
     _group = group;
 56  
   }
 57  
 */
 58  0
   public ClearCacheTag() {
 59  0
     _group = null;
 60  0
     _key = null;
 61  0
   }
 62  
 
 63  
   public int doStartTag() {
 64  0
     return SKIP_BODY;
 65  
   }
 66  
 
 67  
   public int doEndTag() throws JspException {
 68  0
     if(null != _key) {
 69  0
       CacheTag.getCache(_name).clear(_key);
 70  0
     } else if(null != _group) {
 71  0
       CacheTag.getCache(_name).clearGroup(_group);
 72  
     } else {
 73  0
       CacheTag.getCache(_name).clear();
 74  
     }
 75  0
     return EVAL_PAGE;
 76  
   }
 77  
 
 78  
   public void release() {
 79  0
     _group = null;
 80  0
     _key = null;
 81  0
     _name = null;
 82  0
   }
 83  
 }