@Override public int SizeOfQueue() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); return SLAProcessorSingleton.GetQueueSize(); } }
@Override public void Start() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); SLAProcessorSingleton.setRunning(true); SLAProcessorSingleton.run(); }
@Override public void Stop() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); SLAProcessorSingleton.setRunning(false); }
SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); org.oasis_open.docs.wsdm.muws2_2.ObjectFactory f = new org.oasis_open.docs.wsdm.muws2_2.ObjectFactory(); for (int i = 0; i < slaActionBaseType.size(); i++) { SLAProcessorSingleton.EnqueueAlert(alert);
static synchronized void EnqueueAlert(AlertContainer alertContainer) { queue.add(alertContainer); log.log(Level.DEBUG, "Enqueue alert " + alertContainer.getSLAID()); run(); }
protected static void run() { ReentrantLock lock = new ReentrantLock(); lock.lock(); try { if (!isRunning() || t == null) { log.log(Level.INFO, " == fgsms Alerting== launched new thread send out alerts."); try { t = new Thread(new AlertRunner(queue), "SLA Alerting Thread " + UUID.randomUUID().toString()); t.start(); if (!t.isAlive()) { throw new NullPointerException("completely unexpected error starting the SLA alerting thread"); } } catch (Exception ex) { ex.printStackTrace(); log.log(Level.FATAL, "******************************************************* fgsms could not start the SLA Processor Alerting Thread. This is most likely due to server overloading, memory limits or hitting the maxium thread pool for the container. Please consider revising. " + "Purging " + queue.size() + " from the outbound queue to prevent container overload. *********************************************", ex); try { queue.clear(); } catch (Exception ex2) { } } } } finally { lock.unlock(); } } }
@Override public void run() { try { AlertContainer poll = queue.poll(); if (poll != null) { SLACommon slac = new SLACommon(); do { slac.DoAlerts(poll); poll = queue.poll(); } while (poll != null); } SLAProcessorSingleton.setRunning(false); log.log(org.apache.log4j.Level.INFO, SLACommon.getBundleString("InternalAlertingSingletonStop")); } catch (Throwable t) { log.log(org.apache.log4j.Level.FATAL, SLACommon.getBundleString("InternalAlertingSingletonStop"), t); t.printStackTrace(); } } }