public static void main(String[] args) {
try {
notificationType = new URI("trafficAdvisory");
String compositeName = "TrafficAdvisoryNotification.composite";
SCADomain domain = SCADomain.newInstance(compositeName);
TestCaseProducer testCaseProducer = domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer");
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String value = "";
if (args.length == 1) {
value = args[0];
}
do {
if(value == null || value.equals("end")) {
break;
}
try {
System.out.println("Send a report value, ^C or 'end' to end");
value = reader.readLine();
} catch (IOException e) {
e.printStackTrace();
}
if (value.equals("rb")) {
NotificationBindingProviderFactory.removeBroker(notificationType);
}
else {
testCaseProducer.produceTrafficNotification("Report value [" + value + "]");
}
}
while(true);
domain.close();
} catch(Throwable e) {
e.printStackTrace();
}
}