org.hd.d.pg2k.webSvr.util
Class PluginFilter

java.lang.Object
  extended by org.hd.d.pg2k.webSvr.util.PluginFilter
All Implemented Interfaces:
javax.servlet.Filter

public final class PluginFilter
extends java.lang.Object
implements javax.servlet.Filter

Filter to dynamically load and wrap a pluggable filter. This enables filters to be loaded entirely at runtime.

The param pluginClassName is used to give the class name of a Filter class to load and pass filter calls on to. If this class cannot be found or loaded, or is not specified, this PluginFilter performs no transformations at all.


Field Summary
private  javax.servlet.FilterConfig config
          The filter configuration object we are associated with.
private  javax.servlet.Filter plugin
          Our plug-in class; or null if none loaded.
private  java.lang.String pluginClassName
          Config parameter; name of flag to record overload, or null if none chosen.
 
Constructor Summary
PluginFilter()
           
 
Method Summary
 void destroy()
          Take this filter out of service.
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Called to handle each request.
 void init(javax.servlet.FilterConfig filterConfig)
          Place this filter into service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

private javax.servlet.FilterConfig config
The filter configuration object we are associated with. If this value is null, this filter instance is not currently configured.


pluginClassName

private java.lang.String pluginClassName
Config parameter; name of flag to record overload, or null if none chosen.


plugin

private javax.servlet.Filter plugin
Our plug-in class; or null if none loaded.

Constructor Detail

PluginFilter

public PluginFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
Place this filter into service. Defer starting the timer until the first activity that we see...

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - the filter configuration object

destroy

public void destroy()
Take this filter out of service.

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Called to handle each request.

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.