use of org.apache.airavata.common.exception.AiravataException 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.common.exception.AiravataException 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();
}
use of org.apache.airavata.common.exception.AiravataException in project airavata by apache.
the class WorkflowInterpreter method launchWorkflow.
/**
* Package-Private method.
*
* @throws Exception
*/
void launchWorkflow() throws Exception {
// WorkflowBuilder workflowBuilder = WorkflowFactory.getWorkflowBuilder(experiment.getExperimentId(), credentialToken, null);
workflowString = getWorkflow();
WorkflowParser workflowParser = WorkflowFactory.getWorkflowParser(workflowString);
log.debug("Initialized workflow parser");
workflowParser.parse();
setInputNodes(workflowParser.getInputNodes());
log.debug("Parsed the workflow and got the workflow input nodes");
// process workflow input nodes
processWorkflowInputNodes(getInputNodes());
if (readyList.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (InputNode inputNode : inputNodes) {
sb.append(", ");
sb.append(inputNode.getInputObject().getName());
sb.append("=");
sb.append(inputNode.getInputObject().getValue());
}
throw new AiravataException("No workflow application node is in ready state to run with experiment inputs" + sb.toString());
}
processReadyList();
}
use of org.apache.airavata.common.exception.AiravataException in project airavata by apache.
the class WorkflowInterpreter method processReadyList.
// try to remove synchronization tag
/**
* Package-Private method.
*
* @throws RegistryException
* @throws AiravataException
*/
void processReadyList() throws RegistryException, AiravataException {
if (readyList.isEmpty() && processingQueue.isEmpty() && !waitingList.isEmpty()) {
throw new AiravataException("No workflow application node is in ready state to run");
}
for (WorkflowNode readyNode : readyList.values()) {
if (readyNode instanceof OutputNode) {
OutputNode outputNode = (OutputNode) readyNode;
outputNode.getOutputObject().setValue(outputNode.getInPort().getInputObject().getValue());
addToCompleteOutputNodeList(outputNode);
} else if (readyNode instanceof InputNode) {
// FIXME: set input object of applications and add applications to ready List.
} else if (readyNode instanceof ApplicationNode) {
// FIXME: call orchestrator to create process for the application
} else {
throw new RuntimeException("Unsupported workflow node type");
}
}
if (processingQueue.isEmpty() && waitingList.isEmpty()) {
try {
saveWorkflowOutputs();
} catch (AppCatalogException e) {
throw new AiravataException("Error while updating completed workflow outputs to registry", e);
}
}
}
use of org.apache.airavata.common.exception.AiravataException in project airavata by apache.
the class XMLUtil method deepClone.
/**
* @param element
* @return The cloned XmlElement.
*/
public static org.xmlpull.infoset.XmlElement deepClone(org.xmlpull.infoset.XmlElement element) throws AiravataException {
try {
XmlElement clonedElement = element.clone();
clonedElement.setParent(null);
return clonedElement;
} catch (CloneNotSupportedException e) {
// This should not happen because we don't put any special Objects.
throw new AiravataException(e.getMessage(), e);
}
}
Aggregations