01: /*
02: * GNetWatch
03: * Copyright 2006, 2007 Alexandre Fenyo
04: * gnetwatch@fenyo.net
05: *
06: * This file is part of GNetWatch.
07: *
08: * GNetWatch is free software; you can redistribute it and/or modify
09: * it under the terms of the GNU General Public License as published by
10: * the Free Software Foundation; either version 2 of the License, or
11: * (at your option) any later version.
12: *
13: * GNetWatch is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with GNetWatch; if not, write to the Free Software
20: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21: */
22:
23: package net.fenyo.gnetwatch.activities;
24:
25: import java.util.LinkedList;
26: import java.util.List;
27:
28: import net.fenyo.gnetwatch.*;
29: import net.fenyo.gnetwatch.GUI.*;
30: import net.fenyo.gnetwatch.actions.Action;
31: import net.fenyo.gnetwatch.targets.*;
32:
33: import org.apache.commons.logging.Log;
34: import org.apache.commons.logging.LogFactory;
35:
36: /**
37: * This queue holds HTTP actions.
38: * @author Alexandre Fenyo
39: * @version $Id: HTTPQueue.java,v 1.2 2007/03/08 18:21:31 fenyo Exp $
40: */
41:
42: public class HTTPQueue extends Queue implements Runnable {
43: private static Log log = LogFactory.getLog(HTTPQueue.class);
44:
45: /**
46: * Constructor.
47: * @param name queue name.
48: * @param config configuration.
49: */
50: // main thread
51: public HTTPQueue(final String name, final Config config) {
52: super (name, config);
53: setDescription(config.getString("dedicated_for_http"));
54: }
55:
56: /**
57: * Returns the time to wait after each cycle.
58: * @param none.
59: * @return int time to wait.
60: */
61: // Queue thread
62: protected int getCycleDelay() {
63: return 0;
64: }
65:
66: /**
67: * Returns the time to wait between empty cycles.
68: * @param none.
69: * @return time to wait.
70: */
71:
72: // Queue thread
73: protected int getEmptyCycleDelay() {
74: return 1000;
75: }
76:
77: /**
78: * Returns the time to wait between two actions.
79: * @param none.
80: * @return time to wait.
81: */
82: // Queue thread
83: protected int getActionDelay() {
84: return 0;
85: }
86: }
|