View Javadoc

1   /*
2    * $Id: TestFilter.java 357368 2005-12-17 19:17:51Z mrdon $
3    *
4    * Copyright 2000-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.struts.scripting;
20  
21  // util imports:
22  import java.util.Properties;
23  
24  // logging imports:
25  import org.apache.commons.logging.Log;
26  import org.apache.commons.logging.LogFactory;
27  
28  // misc imports:
29  import org.apache.bsf.BSFManager;
30  
31  
32  /***
33   *  Tests to make sure the filtering system is working.
34   */
35  public class TestFilter implements BSFManagerFilter {
36  
37      /*** Logging instance. */
38      private static final Log LOG = LogFactory.getLog(TestFilter.class);
39  
40      /***
41       *  Initializes the filter.
42       *
43       * @param name The name of the filter
44       * @param props The properties
45       */
46      public void init(String name, Properties props) {
47          LOG.info("Initializing TestFilter");
48      }
49  
50      /***
51       *  Applies the filter.
52       *
53       * @param mgr The bsf manager
54       * @return The bsf manager
55       */
56      public BSFManager apply(BSFManager mgr) {
57          LOG.info("Filtering in TestFilter");
58          return mgr;
59      }
60  }