All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.filters.CounterFilter

java.lang.Object
   |
   +----w3c.tools.store.AttributeHolder
           |
           +----w3c.tools.store.Resource
                   |
                   +----w3c.tools.store.ResourceFrame
                           |
                           +----w3c.jigsaw.resources.ResourceFilter
                                   |
                                   +----w3c.jigsaw.filters.CounterFilter

public class CounterFilter
extends ResourceFilter
Count the number of hits to the target. This resource maintains the number of hits to some target resource, as one of its persistent attribute. It will decorate the request on the way in with a fake field w3c.jigsaw.filters.CounterFilter.count, that will hold the current hit counts for the target resource to use.


Variable Index

 o ATTR_COUNTER
Attribute index - The counter attribute.
 o STATE_COUNT
The name of the piece if state that receives the hit count value.

Constructor Index

 o CounterFilter()

Method Index

 o ingoingFilter(Request)
We count all accesses, even the one that failed.

Variables

 o STATE_COUNT
 public static final String STATE_COUNT
The name of the piece if state that receives the hit count value. To get to the hit-count, use the getState method of Request, with the following key.

 o ATTR_COUNTER
 protected static int ATTR_COUNTER
Attribute index - The counter attribute.

Constructors

 o CounterFilter
 public CounterFilter()

Methods

 o ingoingFilter
 public synchronized Reply ingoingFilter(Request request)
We count all accesses, even the one that failed. We also define the w3c.jigsaw.filters.CounterFilter.count request state as the number of hits on that resource (stored as an Integer instance).

Parameters:
request - The request being processed.
Returns:
Always null.
Overrides:
ingoingFilter in class ResourceFilter

All Packages  Class Hierarchy  This Package  Previous  Next  Index