1 |
//---PACKAGE DECLARATION--- |
2 |
package uk.org.iscream.client.monitors; |
3 |
|
4 |
//---IMPORTS--- |
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 |
12 |
* |
13 |
* @author $Author: tdb1 $ |
14 |
* @version $Id: WebFeeder__Monitor.java,v 1.2 2001/03/08 23:20:10 tdb1 Exp $ |
15 |
*/ |
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.2 $"; |
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 |
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 |
} |
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.org.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 |
} |