KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > web > deploy > FilterDefDecorator


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.web.deploy;
24
25 import com.sun.enterprise.deployment.web.ServletFilter;
26 import com.sun.enterprise.deployment.web.InitializationParameter;
27
28 import org.apache.catalina.deploy.FilterDef;
29
30 import java.util.HashMap JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.Vector JavaDoc;
33 import java.io.Serializable JavaDoc;
34
35
36 /**
37  * Decorator of class <code>org.apache.catalina.deploy.FilterDef</code>
38  *
39  * @author Jean-Francois Arcand
40  */

41
42 public class FilterDefDecorator extends FilterDef{
43
44     /**
45      * The set of initialization parameters for this filter, keyed by
46      * parameter name.
47      */

48     private Map JavaDoc parameters = null;
49                                     
50     private ServletFilter decoree;
51     
52     public FilterDefDecorator(ServletFilter decoree){
53         this.decoree = decoree;
54         Vector JavaDoc initParams = decoree.getInitializationParameters();
55         InitializationParameter initParam;
56         for (int i=0; i < initParams.size(); i++){
57            initParam = (InitializationParameter)initParams.get(i);
58            addInitParameter( initParam.getName(),initParam.getValue() );
59         }
60     }
61
62
63
64     // ------------------------------------------------------------- Properties
65

66
67     public String JavaDoc getDescription() {
68         return decoree.getDescription();
69     }
70
71     public String JavaDoc getDisplayName() {
72         return decoree.getDisplayName();
73     }
74  
75  
76     public String JavaDoc getFilterClass() {
77         return decoree.getClassName();
78     }
79   
80     public String JavaDoc getFilterName() {
81         return decoree.getName();
82     }
83
84     public String JavaDoc getLargeIcon() {
85         return decoree.getLargeIconUri();
86     }
87
88
89     public String JavaDoc getSmallIcon() {
90         return decoree.getSmallIconUri();
91     }
92
93
94
95    
96 }
97
Popular Tags