ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/WebFeeder__Monitor.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/WebFeeder__Monitor.java (file contents):
Revision 1.2 by tdb, Thu Mar 8 23:20:10 2001 UTC vs.
Revision 1.4 by ajm, Thu Mar 22 17:57:06 2001 UTC

# Line 1 | Line 1
1   //---PACKAGE DECLARATION---
2 < package uk.ac.ukc.iscream.client.monitors;
2 > package uk.org.iscream.client.monitors;
3  
4   //---IMPORTS---
5 < import uk.ac.ukc.iscream.client.*;
6 < import uk.ac.ukc.iscream.core.*;
7 < import uk.ac.ukc.iscream.util.*;
8 < import uk.ac.ukc.iscream.componentmanager.*;
5 > import uk.org.iscream.client.*;
6 > import uk.org.iscream.core.*;
7 > import uk.org.iscream.util.*;
8 > import uk.org.iscream.componentmanager.*;
9  
10   /**
11   * Provides a full XMLPacket feed to the WebFeeder
# Line 13 | Line 13 | import uk.ac.ukc.iscream.componentmanager.*;
13   * @author  $Author$
14   * @version $Id$
15   */
16 < public class WebFeeder__Monitor implements PluginMonitor {
16 > public class WebFeeder__Monitor extends Thread implements PluginMonitor {
17  
18   //---FINAL ATTRIBUTES---
19  
# Line 30 | Line 30 | public class WebFeeder__Monitor implements PluginMonit
30  
31      public WebFeeder__Monitor() {
32          _webFeeder = WebFeeder.getInstance();
33 +        this.start();
34      }
35  
36   //---PUBLIC METHODS---
37  
38 +    public void run() {
39 +        try {
40 +            analysePacket((XMLPacket) getQueue().get(getQueueId()));
41 +        } catch (InvalidQueueException e) {
42 +            _logger.write(this.toString(), Logger.ERROR, "Unable to get queue.");
43 +        }
44 +    }
45 +
46      public void analysePacket(XMLPacket packet) {
47          try {
48              ConfigurationProxy.getInstance().getProperty("WebFeeder", "WebFeeder.latestActive");
# Line 51 | Line 60 | public class WebFeeder__Monitor implements PluginMonit
60       * Overrides the {@link java.lang.Object#toString() Object.toString()}
61       * method to provide clean logging (every class should have this).
62       *
63 <     * This uses the uk.ac.ukc.iscream.util.FormatName class
63 >     * This uses the uk.org.iscream.util.FormatName class
64       * to format the toString()
65       *
66       * @return the name of this class and its CVS revision
# Line 67 | Line 76 | public class WebFeeder__Monitor implements PluginMonit
76  
77   //---ACCESSOR/MUTATOR METHODS---
78  
79 +    protected Queue getQueue() {
80 +        return MonitorManager.getInstance().getAllQueue();
81 +    }
82 +
83 +    protected int getQueueId() {
84 +        if (_qID == -1) {
85 +            _qID = getQueue().getQueue();
86 +        }
87 +        return _qID;
88 +    }
89 +
90   //---ATTRIBUTES---
91      
92      // reference to the WebFeeder
# Line 88 | Line 108 | public class WebFeeder__Monitor implements PluginMonit
108       * system logger that is being used.
109       */
110      private Logger _logger = ReferenceManager.getInstance().getLogger();
111 +    
112 +    protected int _qID = -1;
113  
114   //---STATIC ATTRIBUTES---
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines