Search in sources :

Example 1 with RabbitMQStatusConsumer

use of org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer 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();
}
Also used : Event(org.apache.airavata.xbaya.messaging.event.Event) RabbitMQStatusConsumer(org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer) AiravataException(org.apache.airavata.common.exception.AiravataException)

Aggregations

AiravataException (org.apache.airavata.common.exception.AiravataException)1 RabbitMQStatusConsumer (org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer)1 Event (org.apache.airavata.xbaya.messaging.event.Event)1