All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.filters.AccessLimitFilter

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

public class AccessLimitFilter
extends ResourceFilter
This filters limit the simultaneous accesses to its target resource.


Variable Index

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

Constructor Index

 o AccessLimitFilter()

Method Index

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

Variables

 o ATTR_LIMIT
 protected static int ATTR_LIMIT
Attribute index - The maximum allowed simultaneous accesses.

 o ATTR_TIMEOUT
 protected static int ATTR_TIMEOUT
Attribute index - The time to wait for the lock (if limit reached)

 o count
 protected int count
Current number of requets that have reached the target.

Constructors

 o AccessLimitFilter
 public AccessLimitFilter()

Methods

 o getLimit
 public int getLimit()
Get the maximum number of allowed simultaneous accesses.

 o 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.

 o 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
 o 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