use of org.apache.airavata.xbaya.messaging.event.Event in project airavata by apache.
the class Monitor method unsubscribe.
/**
* Unsubcribe from the ws messager client
* @throws MonitorException
*/
public void unsubscribe(String experimentId) {
// Enable/disable some menu items.
sendSafeEvent(new Event(Event.Type.MONITOR_STOPED));
String id = expIdToSubscribers.remove(experimentId);
if (id != null) {
try {
messageClient.stopListen(id);
} catch (AiravataException e) {
logger.warn("Failed to find the subscriber for experiment id: " + id, e);
}
}
setMonitoring(false);
}
use of org.apache.airavata.xbaya.messaging.event.Event in project airavata by apache.
the class Monitor method start.
/**
* @throws MonitorException
*/
public synchronized void start() throws MonitorException {
// Make sure currently we are not doing any monitoring
stop();
// Reset monitoring variables
monitoringCompleted = false;
monitoringFailed = false;
// Notify listeners that the monitoring is about to start
getEventDataRepository().triggerListenerForPreMonitorStart();
try {
// AiravataUtils.setExecutionAsServer();
this.messageClient = new RabbitMQStatusConsumer("amqp://localhost:5672", "airavata_rabbitmq_exchange");
} catch (AiravataException e) {
String msg = "Failed to start the consumer";
logger.error(msg, e);
throw new MonitorException(msg, e);
}
// Enable/disable some menu items and show the monitor panel.
sendSafeEvent(new Event(Event.Type.MONITOR_STARTED));
getEventDataRepository().triggerListenerForPostMonitorStart();
}
Aggregations