uk.org.iscream.cms.server.filter
Class PluginFilterManager

java.lang.Object
  extended by uk.org.iscream.cms.server.filter.PluginFilterManager

 class PluginFilterManager
extends Object

This class setups up and manages Plugins in a Filter. A list of plugins to use is specified in the configuration, and these are all loaded upon first use of this class. This is a singleton class.

Version:
$Id: PluginFilterManager.java,v 1.14 2004/08/01 10:40:59 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  LinkedList _filterPipeline
          LinkedList for holding the PluginFilter objects (the pipeline).
private static PluginFilterManager _instance
          A reference to the single instance of this class
private  Logger _logger
          This holds a reference to the system logger that is being used.
private  String _name
          This is the friendly identifier of the component this class is running in.
private  ReferenceManager _refman
          A reference to the reference manager in use
private  String _suffix
          file name suffix for plugin filter classes:
 String REVISION
          The current CVS revision of this class
 
Constructor Summary
private PluginFilterManager()
          Private Constructor - this part creates the filter pipeline This is a singleton class, btw.
 
Method Summary
static PluginFilterManager getInstance()
          Return a reference to the single class.
 boolean runFilters(XMLPacket packet)
          apply all of the filters in the pipeline to the packet.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_suffix

private final String _suffix
file name suffix for plugin filter classes:

See Also:
Constant Field Values

_filterPipeline

private LinkedList _filterPipeline
LinkedList for holding the PluginFilter objects (the pipeline).


_instance

private static PluginFilterManager _instance
A reference to the single instance of this class


_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_logger

private Logger _logger
This holds a reference to the system logger that is being used.


_refman

private ReferenceManager _refman
A reference to the reference manager in use

Constructor Detail

PluginFilterManager

private PluginFilterManager()
Private Constructor - this part creates the filter pipeline This is a singleton class, btw.

Method Detail

getInstance

public static PluginFilterManager getInstance()
Return a reference to the single class. Construct it if it does not already exist, otherwise just return the reference.


runFilters

public boolean runFilters(XMLPacket packet)
apply all of the filters in the pipeline to the packet. return true if they all accept the packet. return false if any single filter rejects the packet. return true if there are no filters inthe pipeline.

Parameters:
packet - an XMLPacket to be tested
Returns:
whether the packet can be passed on

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.NameFormat class to format the toString()

Overrides:
toString in class Object
Returns:
the name of this class and its CVS revision


Copyright © 2000-2003 i-scream. All Rights Reserved.