1 |
//---PACKAGE DECLARATION--- |
2 |
package uk.org.iscream.client.alerters; |
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 Alert feed to the singleton instnace |
12 |
* of the WebFeeder. |
13 |
* |
14 |
* See the WebFeeder class for details. |
15 |
* |
16 |
* @author $Author: ajm4 $ |
17 |
* @version $Id: WebFeeder__Alerter.java,v 1.6 2001/03/23 01:09:51 ajm4 Exp $ |
18 |
*/ |
19 |
public class WebFeeder__Alerter extends AlerterSkeleton { |
20 |
|
21 |
//---FINAL ATTRIBUTES--- |
22 |
|
23 |
/** |
24 |
* The current CVS revision of this class |
25 |
*/ |
26 |
public static final String REVISION = "$Revision: 1.6 $"; |
27 |
|
28 |
/** |
29 |
* A description of this alerter |
30 |
*/ |
31 |
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 |
try { |
41 |
_cp.getInstance().getProperty("WebFeeder", "WebFeeder.alertActive"); |
42 |
WebFeeder.getInstance().receiveAlert(alert); |
43 |
} catch (PropertyNotFoundException e) { |
44 |
// we don't care, this means we shouldn't be active |
45 |
} |
46 |
} |
47 |
|
48 |
/** |
49 |
* Return the String representation of what the alerter does |
50 |
* |
51 |
* @return the description |
52 |
*/ |
53 |
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 |
* This uses the uk.org.iscream.util.FormatName class |
62 |
* 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 |
|
77 |
//---ATTRIBUTES--- |
78 |
|
79 |
/** |
80 |
* This is the friendly identifier of the |
81 |
* component this class is running in. |
82 |
* eg, a Filter may be called "filter1", |
83 |
* If this class does not have an owning |
84 |
* component, a name from the configuration |
85 |
* can be placed here. This name could also |
86 |
* be changed to null for utility classes. |
87 |
*/ |
88 |
private String _name = "WebFeeder"; |
89 |
|
90 |
//---STATIC ATTRIBUTES--- |
91 |
|
92 |
} |