    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.filters.CounterFilter

    java.lang.Object
       |
       +----org.w3c.tools.resources.AttributeHolder
               |
               +----org.w3c.tools.resources.Resource
                       |
                       +----org.w3c.tools.resources.FramedResource
                               |
                               +----org.w3c.tools.resources.ResourceFrame
                                       |
                                       +----org.w3c.tools.resources.ResourceFilter
                                               |
                                               +----org.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 `org.w3c.jigsaw.filters.CounterFilter.count`, that will hold the current hit counts for the target resource to use.

##

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

##

CounterFilter()

##

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

##

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.

ATTR_COUNTER

     protected static int ATTR_COUNTER

  Attribute index - The counter attribute.

##

CounterFilter

     public CounterFilter()

##

ingoingFilter

     public synchronized ReplyInterface ingoingFilter(RequestInterface req)

  We count all accesses, even the one that failed. We also define the `org.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