Enhydra 5.1 API

org.enhydra.servlet.filter
Class MultiServerFilter

java.lang.Object
  |
  +--org.enhydra.servlet.filter.Filter
        |
        +--org.enhydra.servlet.filter.MultiServerFilter
Direct Known Subclasses:
StandardLoggingFilter

public abstract class MultiServerFilter
extends Filter

This is the base class for filters specified by the administrator in the MultiServer config file.

Any filter specified in the MultiServer config file must have two propeties: it must implement the TransactionFilter interface, and it must have a constructor that takes a string and a KeywordValueTable. This abstract class provides these for you, which is why it is recommended that you extend this class if you need to write your own filter for the MultiServer. However, it is possible that a filter absolutly must extend some other class (for example, the RMI connection method can not extend StandardConnectionMethod because it must extend an object from the RMI library). Unless there is a specific reason, filters intended to be listed in the MultiServer config file should extend this class.

This is an abstract class; if you extend it you must implement the wrap() function. When the MultiServer reads it's conifig file, the server administrator may list filters to be applied to a channel. The classname of the filters is specified. It is the responsibility of the MultiServer to create these filter objects and to install them into the correct channels. In order to be able to instantiate the filters, they must all have a well-known constructor. That is what this class ensures.

The constructor, which will most likely be overridden, takes a description string and a KeywordValueTable (KVT). The KVT is used to allow a flexible way for initial arguments to be passed in to the filter. In the MultiServer config file, an entire hierarchy of key=value pairs can be specified as the initial arguments to the filter. This sub-tree is extracted to it's own KVT, and passed in to the filter. Therefore, even though all the filters must use the same constructor, the set of initial arguments is completely up to the developer of the filter.

Author:
Andy John
, Shawn McMurdo
See Also:
org.enhydra.servlet.filter.TransactionFilter, KeywordValueTable

Constructor Summary
MultiServerFilter(java.lang.String description, KeywordValueTable initArgs)
          Create a new filter.
 
Methods inherited from class org.enhydra.servlet.filter.Filter
getDescription, getDestroyInterceptor, getInitInterceptor, getServiceInterceptor, registerInterceptors, setDescription, setDestroyInterceptor, setInitInterceptor, setServiceInterceptor, toString, unregisterInterceptors, wrapRequest, wrapResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiServerFilter

public MultiServerFilter(java.lang.String description,
                         KeywordValueTable initArgs)
Create a new filter. You will probably want to override this to process your initial arguments. The description is saved and will be returned by toString(). The initial arguments are ignored.

Note: if you define other constructors, which take other arguments, they will not be called. The MultiServer will be instantiating instances of this class, and it will only use this constructor.

Parameters:
description - A human readable description of this filter.
initArgs - A KeywordValueTable, populated with whatever key=value paris were specified as the initial arguments in the MultiServer config file. If no initial arguments were given in the config file, this will be null.

Enhydra 5.1 API