KickJava   Java API By Example, From Geeks To Geeks.

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


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 import org.eclipse.swt.layout.GridData;
37 import org.eclipse.swt.widgets.TreeItem;
38
39 /**
40  * This class implements a queue used to run debugging actions in background.
41  * @author Alexandre Fenyo
42  * @version $Id: DebugQueue.java,v 1.12 2007/03/08 18:21:31 fenyo Exp $
43  */

44
45 public class DebugQueue extends Queue implements Runnable JavaDoc {
46   private static Log log = LogFactory.getLog(DebugQueue.class);
47
48   private GUI gui = null;
49   private static int cnt = 0;
50
51   /**
52    * Constructor.
53    * @param name queue name.
54    * @param config configuration.
55    */

56   // main thread
57
public DebugQueue(final String JavaDoc name, final Config config) {
58     super(name, config);
59     setDescription("debug and test operations");
60   }
61
62   /**
63    * Called after each cycle.
64    * @param none.
65    * @return void.
66    */

67   // Queue thread
68
protected void informCycle() {}
69
70   /**
71    * Sets the current GUI instance.
72    * @param gui current GUI instance.
73    * @return void.
74    */

75   // main thread
76
public void setGUI(final GUI gui) {
77     this.gui = gui;
78   }
79
80   /**
81    * Returns the time to wait after each cycle.
82    * @param none.
83    * @return int time to wait.
84    */

85   // Queue thread
86
protected int getCycleDelay() {
87     return 1000;
88   }
89
90   /**
91    * Returns the time to wait between empty cycles.
92    * @param none.
93    * @return time to wait.
94    */

95   // Queue thread
96
protected int getEmptyCycleDelay() {
97     return 1000;
98   }
99
100   /**
101    * Returns the time to wait between two actions.
102    * @param none.
103    * @return time to wait.
104    */

105   // Queue thread
106
protected int getActionDelay() {
107     return 1000;
108   }
109 }
110
Popular Tags