1 |
tdb |
1.1 |
//---PACKAGE DECLARATION--- |
2 |
|
|
package uk.ac.ukc.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.*; |
9 |
|
|
|
10 |
|
|
/** |
11 |
|
|
* Provides a full XMLPacket feed to the WebFeeder |
12 |
|
|
* |
13 |
tdb |
1.2 |
* @author $Author: tdb1 $ |
14 |
|
|
* @version $Id: WebFeeder__Monitor.java,v 1.1 2001/03/07 01:55:59 tdb1 Exp $ |
15 |
tdb |
1.1 |
*/ |
16 |
|
|
public class WebFeeder__Monitor implements PluginMonitor { |
17 |
|
|
|
18 |
|
|
//---FINAL ATTRIBUTES--- |
19 |
|
|
|
20 |
|
|
/** |
21 |
|
|
* The current CVS revision of this class |
22 |
|
|
*/ |
23 |
|
|
public static final String REVISION = "$Revision: 1.1 $"; |
24 |
|
|
|
25 |
|
|
public static final String DESC = "Provides a feed to WebFeeder"; |
26 |
|
|
|
27 |
|
|
//---STATIC METHODS--- |
28 |
|
|
|
29 |
|
|
//---CONSTRUCTORS--- |
30 |
|
|
|
31 |
|
|
public WebFeeder__Monitor() { |
32 |
|
|
_webFeeder = WebFeeder.getInstance(); |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
//---PUBLIC METHODS--- |
36 |
|
|
|
37 |
|
|
public void analysePacket(XMLPacket packet) { |
38 |
tdb |
1.2 |
try { |
39 |
|
|
ConfigurationProxy.getInstance().getProperty("WebFeeder", "WebFeeder.latestActive"); |
40 |
|
|
_webFeeder.receiveXMLPacket(packet); |
41 |
|
|
} catch (PropertyNotFoundException e) { |
42 |
|
|
// we don't care, this means we shouldn't be active |
43 |
|
|
} |
44 |
tdb |
1.1 |
} |
45 |
|
|
|
46 |
|
|
public String getDescription() { |
47 |
|
|
return DESC; |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
/** |
51 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
52 |
|
|
* method to provide clean logging (every class should have this). |
53 |
|
|
* |
54 |
|
|
* This uses the uk.ac.ukc.iscream.util.FormatName class |
55 |
|
|
* to format the toString() |
56 |
|
|
* |
57 |
|
|
* @return the name of this class and its CVS revision |
58 |
|
|
*/ |
59 |
|
|
public String toString() { |
60 |
|
|
return FormatName.getName( |
61 |
|
|
_name, |
62 |
|
|
getClass().getName(), |
63 |
|
|
REVISION); |
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
//---PRIVATE METHODS--- |
67 |
|
|
|
68 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
69 |
|
|
|
70 |
|
|
//---ATTRIBUTES--- |
71 |
|
|
|
72 |
|
|
// reference to the WebFeeder |
73 |
|
|
WebFeeder _webFeeder; |
74 |
|
|
|
75 |
|
|
/** |
76 |
|
|
* This is the friendly identifier of the |
77 |
|
|
* component this class is running in. |
78 |
|
|
* eg, a Filter may be called "filter1", |
79 |
|
|
* If this class does not have an owning |
80 |
|
|
* component, a name from the configuration |
81 |
|
|
* can be placed here. This name could also |
82 |
|
|
* be changed to null for utility classes. |
83 |
|
|
*/ |
84 |
|
|
private String _name = "WebFeeder"; |
85 |
|
|
|
86 |
|
|
/** |
87 |
|
|
* This holds a reference to the |
88 |
|
|
* system logger that is being used. |
89 |
|
|
*/ |
90 |
|
|
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
91 |
|
|
|
92 |
|
|
//---STATIC ATTRIBUTES--- |
93 |
|
|
|
94 |
|
|
} |