KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > fenyo > gnetwatch > activities > HTTPQueue


1
2 /*
3  * GNetWatch
4  * Copyright 2006, 2007 Alexandre Fenyo
5  * gnetwatch@fenyo.net
6  *
7  * This file is part of GNetWatch.
8  *
9  * GNetWatch is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * GNetWatch is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with GNetWatch; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */

23
24 package net.fenyo.gnetwatch.activities;
25
26 import java.util.LinkedList JavaDoc;
27 import java.util.List JavaDoc;
28
29 import net.fenyo.gnetwatch.*;
30 import net.fenyo.gnetwatch.GUI.*;
31 import net.fenyo.gnetwatch.actions.Action;
32 import net.fenyo.gnetwatch.targets.*;
33
34 import org.apache.commons.logging.Log;
35 import org.apache.commons.logging.LogFactory;
36
37 /**
38  * This queue holds HTTP actions.
39  * @author Alexandre Fenyo
40  * @version $Id: HTTPQueue.java,v 1.2 2007/03/08 18:21:31 fenyo Exp $
41  */

42
43 public class HTTPQueue extends Queue implements Runnable JavaDoc {
44   private static Log log = LogFactory.getLog(HTTPQueue.class);
45
46   /**
47    * Constructor.
48    * @param name queue name.
49    * @param config configuration.
50    */

51   // main thread
52
public HTTPQueue(final String JavaDoc name, final Config config) {
53     super(name, config);
54     setDescription(config.getString("dedicated_for_http"));
55   }
56
57   /**
58    * Returns the time to wait after each cycle.
59    * @param none.
60    * @return int time to wait.
61    */

62   // Queue thread
63
protected int getCycleDelay() {
64     return 0;
65   }
66
67   /**
68    * Returns the time to wait between empty cycles.
69    * @param none.
70    * @return time to wait.
71    */

72
73   // Queue thread
74
protected int getEmptyCycleDelay() {
75     return 1000;
76   }
77
78   /**
79    * Returns the time to wait between two actions.
80    * @param none.
81    * @return time to wait.
82    */

83   // Queue thread
84
protected int getActionDelay() {
85     return 0;
86   }
87 }
88
Popular Tags