--- projects/cms/source/util/uk/org/iscream/cms/util/QueueMonitor.java 2001/02/28 19:02:22 1.4
+++ projects/cms/source/util/uk/org/iscream/cms/util/QueueMonitor.java 2002/05/18 18:16:04 1.9
@@ -1,8 +1,27 @@
+/*
+ * i-scream central monitoring system
+ * Copyright (C) 2000-2002 i-scream
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
//---PACKAGE DECLARATION---
-package uk.ac.ukc.iscream.util;
+package uk.org.iscream.cms.server.util;
//---IMPORTS---
-import uk.ac.ukc.iscream.util.*;
+import uk.org.iscream.cms.server.util.*;
/**
* This class monitors a given Queue at regular intervals,
@@ -10,7 +29,7 @@ import uk.ac.ukc.iscream.util.*;
* same Queue being monitored.
*
* @author $Author: tdb $
- * @version $Id: QueueMonitor.java,v 1.4 2001/02/28 19:02:22 tdb Exp $
+ * @version $Id: QueueMonitor.java,v 1.9 2002/05/18 18:16:04 tdb Exp $
*/
class QueueMonitor extends Thread {
@@ -19,7 +38,7 @@ class QueueMonitor extends Thread {
/**
* The current CVS revision of this class
*/
- public static final String REVISION = "$Revision: 1.4 $";
+ public static final String REVISION = "$Revision: 1.9 $";
//---STATIC METHODS---
@@ -34,6 +53,9 @@ class QueueMonitor extends Thread {
* @param name A name to identify the source Queue with
*/
public QueueMonitor (Queue sourceQueue, Queue destQueue, long interval, String name) {
+ // set the Thread name
+ setName("util.QueueMonitor");
+
_sourceQueue = sourceQueue;
_destQueue = destQueue;
_interval = interval;
@@ -71,9 +93,11 @@ class QueueMonitor extends Thread {
public void shutdown() {
// this will stop the main loop
_run = false;
+ // get a hash of our Queue (for identification)
+ String hashCode = String.valueOf(_sourceQueue.hashCode());
// create some XML
String date = new Long(System.currentTimeMillis()/((long) 1000)).toString();
- String xml = "";
+ String xml = "";
// write XML to destination Queue
_destQueue.add(xml);
}
@@ -82,7 +106,7 @@ class QueueMonitor extends Thread {
* Overrides the {@link java.lang.Object#toString() Object.toString()}
* method to provide clean logging (every class should have this).
*
- * This uses the uk.ac.ukc.iscream.util.FormatName class
+ * This uses the uk.org.iscream.cms.server.util.FormatName class
* to format the toString()
*
* @return the name of this class and its CVS revision