/** * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setup() */ public void setup() throws WorkflowException { Class[] parameters = new Class[] { URL.class }; URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Class sysclass = URLClassLoader.class; try { Method method = sysclass.getDeclaredMethod("addURL", parameters); method.setAccessible(true); method.invoke(sysloader, new Object[] { this.jarUrl }); } catch (Throwable t) { t.printStackTrace(); throw new WorkflowException("Error, could not add URL to system classloader"); } }
/** * * @param operationName * The name of the operation * @throws WorkflowException */ public void setOperation(String operationName) throws WorkflowException { try { this.invoker.setOperation(operationName); } catch (WorkflowException e) { logger.error(e.getMessage(), e); // An appropriate message has been set in the exception. this.notifier.invocationFailed(e.getMessage(), e); throw e; } catch (RuntimeException e) { logger.error(e.getMessage(), e); String message = "The WSDL does not conform to the invoking service: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } }
@Override public void run() { try { runInThread(listOfValues, forEachNode, foreachWSNode, finalEndForEachNodes, finalInvokerMap, counter, inputNumbers); } catch (WorkflowException e) { log.error(e.getLocalizedMessage(), e); } catch (RegistryException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
@Override public void run() { try { Monitor.this.stop(); } catch (WorkflowException e) { // Ignore the error in unsubscription. logger.error(e.getMessage(), e); } } }.start();
public void run() { try { workflowInterpreter.scheduleDynamically(); } catch (WorkflowException e) { e.printStackTrace(); } catch (RegistryException e) { e.printStackTrace(); } catch (AiravataException e) { e.printStackTrace(); } }; }.start();
@Override public void run() { try { Monitor.this.stop(); } catch (WorkflowException e) { // Ignore the error in unsubscription. logger.error(e.getMessage(), e); } } }.start();
/** * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setup() */ public void setup() throws WorkflowException { Class[] parameters = new Class[] { URL.class }; URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Class sysclass = URLClassLoader.class; try { Method method = sysclass.getDeclaredMethod("addURL", parameters); method.setAccessible(true); method.invoke(sysloader, new Object[] { this.jarUrl }); } catch (Throwable t) { t.printStackTrace(); throw new WorkflowException("Error, could not add URL to system classloader"); } }
public Object getOutput(String name) throws WorkflowException { try { waitToFinish(); Object output = super.getOutput(name); if (output instanceof XmlElement) { logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output)); } return output; } catch (WorkflowException e) { logger.error(e.getMessage(), e); // An appropriate message has been set in the exception. if (!this.failerSent) { this.notifier.invocationFailed(e.getMessage(), e); } throw e; } catch (RuntimeException e) { logger.error(e.getMessage(), e); String message = "Error while waiting for a output: " + name; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } }
@Override public void windowClosing(WindowEvent event) { int result = JOptionPane.showConfirmDialog(frame, "Are you sure you want to exit?", "Exit XBaya", JOptionPane.YES_NO_OPTION); if (result==JOptionPane.NO_OPTION || (!closeAllGraphCanvas())){ return; } logger.debug(event.toString()); XBayaGUI.this.frame.setVisible(false); try { XBayaGUI.this.engine.dispose(); } catch (WorkflowException e) { // Ignore the error. logger.error(e.getMessage(), e); } catch (RuntimeException e) { // Ignore the error. logger.error(e.getMessage(), e); } if (XBayaGUI.this.engine.getConfiguration().isCloseOnExit()) { System.exit(0); } }
@Override public void run() { try { runInThread(listOfValues, forEachNode, node1, finalEndForEachNodes, finalMap, counter, inputNumbers); } catch (WorkflowException e) { log.error(e.getLocalizedMessage(), e); } catch (RegistryException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (TException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
/** * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke() */ public boolean invoke() throws WorkflowException { try { Class<?> targetClass = Class.forName(this.className); Object obj = targetClass.newInstance(); Method[] methods = targetClass.getDeclaredMethods(); Method targetMethod = null; for (Method method : methods) { if (this.operationName.equals(method.getName())) { targetMethod = method; break; } } if (targetMethod == null) { throw new WorkflowException("Could not find the method using reflection: " + this.operationName); } targetMethod.setAccessible(true); this.result = targetMethod.invoke(obj, inputs); } catch (Exception e) { throw new WorkflowException(e); } return true; }
this.invoker.setInput(name, value); } catch (WorkflowException e) { logger.error(e.getMessage(), e); this.notifier.invocationFailed(e.getMessage(), e); throw e; } catch (RuntimeException e) { String message = "Error in setting an input. name: " + name + " value: " + value; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e);
logger.error(e.getMessage(), e); WorkflowInvokerWrapperForGFacInvoker.this.notifier.invocationFailed(e.getMessage(), e); WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true; throw new WorkflowRuntimeException(e);
/** * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke() */ public boolean invoke() throws WorkflowException { try { Class<?> targetClass = Class.forName(this.className); Object obj = targetClass.newInstance(); Method[] methods = targetClass.getDeclaredMethods(); Method targetMethod = null; for (Method method : methods) { if (this.operationName.equals(method.getName())) { targetMethod = method; break; } } if (targetMethod == null) { throw new WorkflowException("Could not find the method using reflection: " + this.operationName); } targetMethod.setAccessible(true); this.result = targetMethod.invoke(obj, inputs); } catch (Exception e) { throw new WorkflowException(e); } return true; }
logger.error(e.getMessage(), e); this.notifier.invocationFailed(e.getMessage(), e); throw e; } catch (URISyntaxException e) { String message = "The location of the WSDL has to be a valid URL or file path: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (WsdlException e) { logger.error(e.getMessage(), e); String message = "Error in processing the WSDL: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (RuntimeException e) { logger.error(e.getMessage(), e); String message = "Error in processing the WSDL: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); }catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e);
logger.error(e.getMessage(), e); GenericInvoker.this.notifier.invocationFailed(e.getMessage(), e); GenericInvoker.this.failerSent = true; throw new WorkflowRuntimeException(e);
/** * @see org.apache.airavata.xbaya.invoker.Invoker#invoke() */ public boolean invoke() throws WorkflowException { try { boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage, this.faultMessage); while(this.outputMessage == null){ } return success; } catch (RuntimeException e) { String message = "Error in invoking a service."; throw new WorkflowException(message, e); } }
logger.error(e.getMessage(), e); this.notifier.invocationFailed(e.getMessage(), e); String message = "Error while waiting for a output: " + name; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e);
/** * @see org.apache.airavata.workflow.engine.invoker.Invoker#invoke() */ public boolean invoke() throws WorkflowException { try { boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage, this.faultMessage); while(this.outputMessage == null){ } return success; } catch (RuntimeException e) { String message = "Error in invoking a service."; throw new WorkflowException(message, e); } }
/** * Sends an event. * * @param event * @throws org.apache.airavata.workflow.model.exceptions.WorkflowException */ public void sendEvent(Event event) throws WorkflowException { Throwable exception = null; for (EventListener listener : this.listeners) { try { listener.eventReceived(event); } catch (Throwable e) { logger.error(e.getMessage(), e); // Just remember the first one. if (exception == null) { exception = e; } } } if (exception != null) { if (exception instanceof WorkflowException) { throw (WorkflowException) exception; } else { throw new WorkflowException(exception); } } }