1 |
tdb |
1.1 |
//---PACKAGE DECLARATION--- |
2 |
tdb |
1.3 |
package uk.org.iscream.client.alerters; |
3 |
tdb |
1.1 |
|
4 |
|
|
//---IMPORTS--- |
5 |
tdb |
1.3 |
import uk.org.iscream.client.*; |
6 |
|
|
import uk.org.iscream.core.*; |
7 |
|
|
import uk.org.iscream.util.*; |
8 |
|
|
import uk.org.iscream.componentmanager.*; |
9 |
tdb |
1.1 |
|
10 |
|
|
/** |
11 |
ajm |
1.6 |
* Provides a full Alert feed to the singleton instnace |
12 |
|
|
* of the WebFeeder. |
13 |
tdb |
1.1 |
* |
14 |
ajm |
1.6 |
* See the WebFeeder class for details. |
15 |
|
|
* |
16 |
tdb |
1.8 |
* @author $Author: tdb1 $ |
17 |
|
|
* @version $Id: WebFeeder__Alerter.java,v 1.7 2001/03/23 02:25:17 tdb1 Exp $ |
18 |
tdb |
1.1 |
*/ |
19 |
ajm |
1.6 |
public class WebFeeder__Alerter extends AlerterSkeleton { |
20 |
tdb |
1.1 |
|
21 |
|
|
//---FINAL ATTRIBUTES--- |
22 |
|
|
|
23 |
|
|
/** |
24 |
|
|
* The current CVS revision of this class |
25 |
|
|
*/ |
26 |
tdb |
1.8 |
public static final String REVISION = "$Revision: 1.7 $"; |
27 |
tdb |
1.1 |
|
28 |
ajm |
1.6 |
/** |
29 |
|
|
* A description of this alerter |
30 |
|
|
*/ |
31 |
tdb |
1.1 |
public static final String DESC = "Provides a feed to WebFeeder"; |
32 |
|
|
|
33 |
|
|
//---STATIC METHODS--- |
34 |
|
|
|
35 |
|
|
//---CONSTRUCTORS--- |
36 |
|
|
|
37 |
|
|
//---PUBLIC METHODS--- |
38 |
|
|
|
39 |
|
|
public void sendAlert(Alert alert) { |
40 |
tdb |
1.2 |
try { |
41 |
ajm |
1.6 |
_cp.getInstance().getProperty("WebFeeder", "WebFeeder.alertActive"); |
42 |
tdb |
1.7 |
WebFeeder.getInstance().receiveAlert(alert); |
43 |
tdb |
1.2 |
} catch (PropertyNotFoundException e) { |
44 |
ajm |
1.6 |
// we don't care, this means we shouldn't be active |
45 |
tdb |
1.2 |
} |
46 |
tdb |
1.1 |
} |
47 |
|
|
|
48 |
ajm |
1.6 |
/** |
49 |
|
|
* Return the String representation of what the alerter does |
50 |
|
|
* |
51 |
|
|
* @return the description |
52 |
|
|
*/ |
53 |
tdb |
1.1 |
public String getDescription() { |
54 |
|
|
return DESC; |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
/** |
58 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
59 |
|
|
* method to provide clean logging (every class should have this). |
60 |
|
|
* |
61 |
tdb |
1.3 |
* This uses the uk.org.iscream.util.FormatName class |
62 |
tdb |
1.1 |
* to format the toString() |
63 |
|
|
* |
64 |
|
|
* @return the name of this class and its CVS revision |
65 |
|
|
*/ |
66 |
|
|
public String toString() { |
67 |
|
|
return FormatName.getName( |
68 |
|
|
_name, |
69 |
|
|
getClass().getName(), |
70 |
|
|
REVISION); |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
//---PRIVATE METHODS--- |
74 |
|
|
|
75 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
76 |
tdb |
1.8 |
|
77 |
|
|
/** |
78 |
|
|
* Returns the "friendly" name of this class. This |
79 |
|
|
* is simply an accessor for _name, required due to |
80 |
|
|
* inheritance issues with extending AlerterSkeleton. |
81 |
|
|
* |
82 |
|
|
* @return the friendly name |
83 |
|
|
*/ |
84 |
|
|
protected String getFName() { |
85 |
|
|
return _name; |
86 |
|
|
} |
87 |
tdb |
1.1 |
|
88 |
|
|
//---ATTRIBUTES--- |
89 |
|
|
|
90 |
|
|
/** |
91 |
|
|
* This is the friendly identifier of the |
92 |
|
|
* component this class is running in. |
93 |
|
|
* eg, a Filter may be called "filter1", |
94 |
|
|
* If this class does not have an owning |
95 |
|
|
* component, a name from the configuration |
96 |
|
|
* can be placed here. This name could also |
97 |
|
|
* be changed to null for utility classes. |
98 |
|
|
*/ |
99 |
|
|
private String _name = "WebFeeder"; |
100 |
|
|
|
101 |
|
|
//---STATIC ATTRIBUTES--- |
102 |
|
|
|
103 |
|
|
} |