1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.miloss.fgsms.sla;
21
22 import java.util.Queue;
23 import org.miloss.fgsms.plugins.sla.AlertContainer;
24 import org.miloss.fgsms.common.Logger;;
25
26
27
28
29
30
31
32 public class AlertRunner implements Runnable {
33
34 private Queue<AlertContainer> queue = null;
35
36 AlertRunner(Queue<AlertContainer> q) {
37 queue = q;
38 }
39 static final Logger log = Logger.getLogger("fgsms.SLAProcessor");
40
41 @Override
42 public void run() {
43 try {
44 AlertContainer poll = queue.poll();
45 if (poll != null) {
46 SLACommon slac = new SLACommon();
47 do {
48 slac.DoAlerts(poll);
49 poll = queue.poll();
50 } while (poll != null);
51 }
52 SLAProcessorSingleton.setRunning(false);
53 log.log(org.apache.log4j.Level.INFO, SLACommon.getBundleString("InternalAlertingSingletonStop"));
54 } catch (Throwable t) {
55 log.log(org.apache.log4j.Level.FATAL, SLACommon.getBundleString("InternalAlertingSingletonStop"), t);
56 t.printStackTrace();
57 }
58 }
59 }