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 ICMP actions.
38: * @author Alexandre Fenyo
39: * @version $Id: PingQueue.java,v 1.12 2007/03/08 18:21:31 fenyo Exp $
40: */
41:
42: public class PingQueue extends Queue implements Runnable {
43: private static Log log = LogFactory.getLog(PingQueue.class);
44:
45: /**
46: * Constructor.
47: * @param name queue name.
48: * @param config configuration.
49: */
50: // main thread
51: public PingQueue(final String name, final Config config) {
52: super (name, config);
53: setDescription(config
54: .getString("dedicated_for_reachability_testing"));
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 1000;
65: }
66:
67: /**
68: * Returns the time to wait between empty cycles.
69: * @param none.
70: * @return time to wait.
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: }
|