    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.jigsaw.filters.AccessLimitFilter

    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.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(RequestInterface)
  Count number of hits to the page, block when limit exceeded.
outgoingFilter(RequestInterface, ReplyInterface)
  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 ReplyInterface ingoingFilter(RequestInterface req) 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.
  Throws: HTTPException
    if access limit is reached.
  Overrides:
    ingoingFilter in class ResourceFilter

outgoingFilter

     public synchronized ReplyInterface outgoingFilter(RequestInterface req,
                                                       ReplyInterface rep)

  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