Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/enhydra/servlet/filter/MultiServerFilter.java


1   /*
2    * Enhydra Java Application Server Project
3    * 
4    * The contents of this file are subject to the Enhydra Public License
5    * Version 1.1 (the "License"); you may not use this file except in
6    * compliance with the License. You may obtain a copy of the License on
7    * the Enhydra web site ( http://www.enhydra.org/ ).
8    * 
9    * Software distributed under the License is distributed on an "AS IS"
10   * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
11   * the License for the specific terms governing rights and limitations
12   * under the License.
13   * 
14   * The Initial Developer of the Enhydra Application Server is Lutris
15   * Technologies, Inc. The Enhydra Application Server and portions created
16   * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17   * All Rights Reserved.
18   * 
19   * Contributor(s):
20   * 
21   * $Id: MultiServerFilter.java,v 1.4.2.1.2.1 2000/10/19 17:59:10 jasona Exp $
22   */
23  
24  package org.enhydra.servlet.filter;
25  
26  import com.lutris.util.KeywordValueTable;
27  
28  
29  /**
30      This is the base class for filters specified by the administrator in the
31      MultiServer config file. <P>
32  
33      Any filter specified in the MultiServer config file must have two
34      propeties: it must implement the TransactionFilter interface, and
35      it must have a constructor that takes a string and a KeywordValueTable.
36      This abstract class provides these for you, which is why it is recommended
37      that you extend this class if you need to write your own filter for
38      the MultiServer. However, it is possible that a filter absolutly must
39      extend some other class (for example, the RMI connection method can
40      not extend StandardConnectionMethod because it must extend an object from
41      the RMI library). Unless there is a specific reason, filters intended
42      to be listed in the MultiServer config file should extend this class. <P>
43  
44      This is an abstract class; if you extend it you must implement the
45      <CODE>wrap()</CODE> function. When the MultiServer reads it's conifig
46      file, the server administrator may list filters to be applied to a
47      channel. The classname of the filters is specified. It is the 
48      responsibility of the MultiServer to create these filter objects
49      and to install them into the correct channels. In order to be able
50      to instantiate the filters, they must all have a well-known 
51      constructor. That is what this class ensures. <P>
52  
53      The constructor, which will most likely be overridden, takes a
54      description string and a KeywordValueTable (KVT). The KVT is used
55      to allow a flexible way for initial arguments to be passed in to
56      the filter. In the MultiServer config file, an entire hierarchy
57      of key=value pairs can be specified as the initial arguments to
58      the filter. This sub-tree is extracted to it's own KVT, and passed
59      in to the filter. Therefore, even though all the filters must use
60      the same constructor, the set of initial arguments is completely
61      up to the developer of the filter.
62  
63      @see org.enhydra.servlet.filter.TransactionFilter
64      @see com.lutris.util.KeywordValueTable
65      @author Andy John
66      @author Shawn McMurdo
67  */
68  abstract public class MultiServerFilter extends Filter {
69  
70      /**
71       *  Create a new filter. You will probably want to override this
72       *  to process your initial arguments. The description is saved
73       *  and will be returned by <CODE>toString()</CODE>. 
74       *  The initial arguments are ignored. <P>
75       *
76       *  Note: if you define other constructors, which take other
77       *  arguments, they will not be called. The MultiServer will be
78       *  instantiating instances of this class, and it will only use
79       *  this constructor.
80       * 
81       *  @param description A human readable description of this filter.
82       *  @param initArgs A KeywordValueTable, populated with whatever
83       *  key=value paris were specified as the initial arguments in the
84       *  MultiServer config file. If no initial arguments were given
85       *  in the config file, this will be null.
86       */
87      public MultiServerFilter(String description, KeywordValueTable initArgs) {
88    super(description);
89      }
90  
91  }
92