    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class w3c.jigsaw.filters.AccessLimitFilter

    java.lang.Object
       |
       +----w3c.jigsaw.resources.AttributeHolder
               |
               +----w3c.jigsaw.resources.Resource
                       |
                       +----w3c.jigsaw.resources.ResourceFilter
                               |
                               +----w3c.jigsaw.filters.AccessLimitFilter

public class AccessLimitFilter
extends ResourceFilter

This filters limit the simultaneous accesses to its target resource.

##

ATTR_LIMIT
  Attribute index - The maximum allowed simultaneous accesses.
ATTR_TIMEOUT
  Attribute index - The time to wait for the lock (if limit reached)
count
  Current number of requets that have reached the target.

##

AccessLimitFilter()

##

getLimit()
  Get the maximum number of allowed simultaneous accesses.
getTimeout()
  Get the timeout before we send back an error.
ingoingFilter(Request)
  Count number of hits to the page, block when limit exceeded.
outgoingFilter(Request, Reply)
  Notify that someone has exit the target entity.

##

ATTR_LIMIT

      protected static int ATTR_LIMIT

  Attribute index - The maximum allowed simultaneous accesses.

ATTR_TIMEOUT

      protected static int ATTR_TIMEOUT

  Attribute index - The time to wait for the lock (if limit reached)

count

      protected int count

  Current number of requets that have reached the target.

##

AccessLimitFilter

      public AccessLimitFilter()

##

getLimit

      public int getLimit()

  Get the maximum number of allowed simultaneous accesses.

getTimeout

      public int getTimeout()

  Get the timeout before we send back an error. A client will wait only for this duration before being thrown an error.

ingoingFilter

      public synchronized Reply ingoingFilter(Request request) throws HTTPException

  Count number of hits to the page, block when limit exceeded. This filter maintains the actual number of hits to its target. When this number exceeds the predefined limit, it blocks the caller until some othre thread exits the target.
  Parameters:
    request - The request to be handled.
  Overrides:
    ingoingFilter in class ResourceFilter

outgoingFilter

      public synchronized Reply outgoingFilter(Request request,
                                               Reply reply) throws HTTPException

  Notify that someone has exit the target entity. This method decrements the actual number of hits to the filter's target, and notify any awaiting threads that they can now enter safely.
  Parameters:
    request - The request being handled.
    reply - The reply to be emited.
  Overrides:
    outgoingFilter in class ResourceFilter

    All Packages  Class Hierarchy  This Package  Previous  Next  Index