Package org.apache.airavata.xbaya

Examples of org.apache.airavata.xbaya.XBayaException


                String message = "Error in a service: ";
                // An implementation of WSIFMessage,
                // WSIFMessageElement, implements toString(), which
                // serialize the message XML.
                message += faultMessage.toString();
                throw new XBayaException(message);
            }
        } catch (InterruptedException e) {
            logger.error(e.getMessage(), e);
        } catch (ExecutionException e) {
            // The service-failed notification should have been sent already.
            logger.error(e.getMessage(), e);
            String message = "Error in invoking a service: " + this.serviceInformation;
            throw new XBayaException(message, e);
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new XBayaException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new XBayaException(message, e);
        }
    }
View Full Code Here


            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 XBayaException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            logger.error(e.getMessage(), e);
            throw new XBayaException(e.getCause());
        }

    }
View Full Code Here

            WSIFPort port = service.getPort();
            this.client = WSIFRuntime.getDefault().newClientFor(port);
            this.client.setAsyncResponseTimeoutInMs(999999999);
        } catch (RuntimeException e) {
            String message = "The WSDL is in the wrong format";
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

            this.inputMessage = this.operation.createInputMessage();
            this.outputMessage = this.operation.createOutputMessage();
            this.faultMessage = this.operation.createFaultMessage();
        } catch (RuntimeException e) {
            String message = "The WSDL does not conform to the invoking service.";
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

                value = "" + value;
            }
            this.inputMessage.setObjectPart(name, value);
        } catch (RuntimeException e) {
            String message = "Error in setting an input. name: " + name + " value: " + value;
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

            }
            return success;
        } catch (RuntimeException e) {
            String message = "Error in invoking a service.";
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

            // Value is a complex type. Return the whole XmlElement so that we
            // can set it to the next service as it is.
            return valueElement;
        } catch (RuntimeException e) {
            String message = "Error in getting output. name: " + name;
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

            while(this.getOutputMessage() == null){
            }
            return true;
        } catch (RuntimeException e) {
            String message = "Error in invoking a service.";
            throw new XBayaException(message, e);
        }
    }
View Full Code Here

              .getJcrComponentRegistry()
              .getRegistry()
              .saveWorkflowExecutionStatus(this.topic,
                  ExecutionStatus.STARTED);
        } catch (RegistryException e) {
          throw new XBayaException(e);
        }
      }
      ArrayList<Node> inputNodes = this.getInputNodesDynamically();
      Object[] values = new Object[inputNodes.size()];
      String[] keywords = new String[inputNodes.size()];
      for (int i = 0; i < inputNodes.size(); ++i) {
        Node node = inputNodes.get(i);
        node.getGUI().setBodyColor(NodeState.FINISHED.color);
        if (this.mode == GUI_MODE) {
          this.engine.getGUI().getGraphCanvas().repaint();
        }
        keywords[i] = ((InputNode) node).getName();
        values[i] = ((InputNode) node).getDefaultValue();
      }
      this.notifier.workflowStarted(values, keywords);
      while (this.getWorkflow().getExecutionState() != XBayaExecutionState.STOPPED) {
        if (getRemainNodesDynamically() == 0) {
          if (this.mode == GUI_MODE) {
            this.notifyPause();
          } else {
            this.getWorkflow().setExecutionState(
                XBayaExecutionState.STOPPED);
          }
        }
        // ok we have paused sleep
        while (this.getWorkflow().getExecutionState() == XBayaExecutionState.PAUSED) {
          try {
            Thread.sleep(400);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
        }
        // get task list and execute them
        ArrayList<Node> readyNodes = this.getReadyNodesDynamically();
        for (Node node : readyNodes) {
          if (node.isBreak()) {
            this.notifyPause();
            break;
          }
          if (this.getWorkflow().getExecutionState() == XBayaExecutionState.PAUSED
              || this.getWorkflow().getExecutionState() == XBayaExecutionState.STOPPED) {
            break;
            // stop executing and sleep in the outer loop cause we
            // want
            // recalculate the execution stack
          }

          boolean nodeOutputLoadedFromProvenance = false;
          if (this.actOnProvenance) {
            nodeOutputLoadedFromProvenance = readProvenance(node);
            } else {
            writeProvenanceLater(node);
          }
          if (!nodeOutputLoadedFromProvenance) {
              executeDynamically(node);
          }
          if (this.getWorkflow().getExecutionState() == XBayaExecutionState.STEP) {
            this.getWorkflow().setExecutionState(
                XBayaExecutionState.PAUSED);
            break;
          }
        }
        // TODO commented this for foreach, fix this.
        sendOutputsDynamically();
        // Dry run sleep a lil bit to release load
        if (readyNodes.size() == 0) {
          // when there are no ready nodes and no running nodes
          // and there are failed nodes then workflow is stuck because
          // of failure
          // so we should pause the execution
          if (InterpreterUtil.getRunningNodeCountDynamically(this.graph) == 0
              && InterpreterUtil.getFailedNodeCountDynamically(this.graph) != 0) {
            this.getWorkflow().setExecutionState(
                XBayaExecutionState.PAUSED);
          }

          try {
            Thread.sleep(400);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
        }
      }

      if (InterpreterUtil.getFailedNodeCountDynamically(this.graph) == 0) {
        if (actOnProvenance) {
          try {
            try {
              this.configuration
                  .getJcrComponentRegistry()
                  .getRegistry()
                  .saveWorkflowExecutionStatus(this.topic,
                      ExecutionStatus.FINISHED);
            } catch (Exception e) {
              throw new XBayaException(e);
            }
          } catch (Exception e) {
            throw new XBayaException(e);
          }
          // System.out.println(this.configuration.getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
        }
      } else {
        if (actOnProvenance) {
          try {
            this.configuration
                .getJcrComponentRegistry()
                .getRegistry()
                .saveWorkflowExecutionStatus(this.topic,
                    ExecutionStatus.FAILED);
          } catch (RegistryException e) {
            throw new XBayaException(e);
          }
        }
      }
      this.notifier.workflowTerminated();
      if (this.mode == GUI_MODE) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.XBayaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.