--- projects/cms/source/server/uk/org/iscream/cms/server/client/AlerterManager.java 2001/03/15 22:12:22 1.4 +++ projects/cms/source/server/uk/org/iscream/cms/server/client/AlerterManager.java 2001/03/22 22:07:14 1.5 @@ -8,19 +8,19 @@ import uk.org.iscream.util.*; import java.util.*; /** - * A manager for the Monitors. + * A manager for the Alerters. * - * @author $Author: tdb $ - * @version $Id: AlerterManager.java,v 1.4 2001/03/15 22:12:22 tdb Exp $ + * @author $Author: ajm $ + * @version $Id: AlerterManager.java,v 1.5 2001/03/22 22:07:14 ajm Exp $ */ -class AlerterManager extends Thread { +public class AlerterManager extends Thread { //---FINAL ATTRIBUTES--- /** * The current CVS revision of this class */ - public static final String REVISION = "$Revision: 1.4 $"; + public static final String REVISION = "$Revision: 1.5 $"; //---STATIC METHODS--- @@ -87,28 +87,6 @@ class AlerterManager extends Thread { } //---PUBLIC METHODS--- - - public void run() { - - boolean run=true; - while(run) { - // attempt to get some data from the Queue - Alert alert = null; - try { - alert = (Alert) _queue.get(_qID); - } - catch(InvalidQueueException e) { - _logger.write(toString(), Logger.ERROR, "Queue failure: "+e); - } - - // for each alerter in the pipeline... - Iterator pluginAlerters = _alerterPipeline.iterator(); - while (pluginAlerters.hasNext()){ - PluginAlerter alerter = (PluginAlerter)pluginAlerters.next(); - alerter.sendAlert(alert); - } - } - } /** * Overrides the {@link java.lang.Object#toString() Object.toString()} @@ -129,6 +107,17 @@ class AlerterManager extends Thread { //---PRIVATE METHODS--- //---ACCESSOR/MUTATOR METHODS--- + + /** + * Allows alerters to obtain a reference + * to the alerting queue so that they can + * process any alerts + * + * @return a reference to the alert queue + */ + public Queue getQueue() { + return _queue; + } //---ATTRIBUTES---