package com.bmc.truesight.plugins.activemq;

import java.util.Date;

public class PluginSimulator {

    public PluginSimulator() {

    }

    public void writeOutput() {
        Date d = new Date();
        String s = "_bevent:TITLE|m:MESSAGE|h:SOURCE|s:SENDER|t:info|tags:red,blue,green";
        System.out.println(s);
        System.out.println("FOO 1.0 BAR " + d.getTime());
        System.out.flush();
    }

    public void run() {
        while(true) {
            try {
                this.writeOutput();
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String args[]) {
        PluginSimulator sim = new PluginSimulator();
        sim.run();
    }
}

@@ -398,24 +398,99 @@
 ut.flush();%0A
+        System.err.print(%22An Error Occurred%22);%0A        System.err.flush();%0A
     %7D%0A%0A    p

Write an error to standard error