KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > core > throttle > Throttle


1 package net.javacoding.jspider.core.throttle;
2
3
4 /**
5  * Interface that will be implemented upon all classes that will act as a
6  * throttle. This type of component will control the load put upon a
7  * certain host, thus keeping the spider threads from doing too much
8  * requests in a too short time frame.
9  *
10  * <p>
11  * If no throttling would be used, our JSpider engine could cause a DOS
12  * attack on the target machine.
13  * </p>
14  * <p>
15  * Please remark that the throttling is done on a per-host base, not on
16  * a per-site base. This means that if you have 2 sites, eg:
17  * <ol>
18  * <li>http://localhost:80/</li>
19  * <li>http://localhost:8080/</li>
20  * <ol>
21  * and you would allow 2 hits/second by configuring a throttle, these
22  * sites would _together_ get 2 hits/second at max, because they're
23  * on the same machine.
24  * Two sites on a difference hostname are throttled independently of
25  * each other.
26  * </p>
27  *
28  * $Id: Throttle.java,v 1.1 2002/11/20 17:26:09 vanrogu Exp $
29  *
30  * @author Günther Van Roey
31  */

32 public interface Throttle {
33
34     /**
35      * Method to which a spider thread will be directed before making
36      * a call on a webserver. This allows the throttle component
37      * implementation to hold the thread under control.
38      */

39     public void throttle();
40
41 }
42
Popular Tags