Package edu.indiana.extreme.xbaya

Examples of edu.indiana.extreme.xbaya.XBayaRuntimeException


    private JarFile maybeGetJarFile(URL url) {
        String path;
        try {
            path = URLDecoder.decode(url.getPath(), "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new XBayaRuntimeException(e);
        }
        logger.finest("path: " + path);
        if (path.endsWith("/")) {
            // url = file:/a/b/c/
            // It's a local directory
            return null;
        } else if ("file".equals(url.getProtocol())) {
            // url = file:/a/b/c.jar
            // Jar file
            try {
                JarFile jarFile = new JarFile(path);
                return jarFile;
            } catch (IOException e) {
                throw new XBayaRuntimeException(e);
            }
        } else {
            // url = http://example.com/a/b/c.jar
            // A Jar file
            try {
                if (this.tmpJarDirectory == null) {
                    Date date = new Date();
                    SimpleDateFormat format = new SimpleDateFormat(
                            "yyyyMMdd-HHmmss-S");
                    String time = format.format(date);
                    String fileName = ".xbaya-jars-" + time;
                    String tmpdir = System.getProperty("java.io.tmpdir");
                    this.tmpJarDirectory = new File(tmpdir, fileName);
                    this.tmpJarDirectory.mkdir();
                }

                int i = path.lastIndexOf('/');
                File file = new File(this.tmpJarDirectory, path
                        .substring(i + 1));
                logger.finest("file: " + file);
                InputStream stream = url.openStream();
                IOUtil.writeToFile(stream, file);
                JarFile jarFile = new JarFile(file);
                return jarFile;
            } catch (IOException e) {
                throw new XBayaRuntimeException(e);
            }
        }
    }
View Full Code Here


            try {
                GraphUtil.propagateTypes(getGraph());
            } catch (GraphException e) {
                // this should not happen.
                throw new XBayaRuntimeException(e);
            }
        }
    }
View Full Code Here

                            .getSelectionPath();
                }
            });
        } catch (InterruptedException e) {
            // Should not happen.
            throw new XBayaRuntimeException(e);
        } catch (InvocationTargetException e) {
            // Should not happen.
            throw new XBayaRuntimeException(e);
        }

        TreePath selectionPath = selectionPathHolder[0];
        if (selectionPath == null) {
            // TODO this case should be handled in the menu before comming here.
View Full Code Here

                        getRegistries(registries);
                    }
                });
            } catch (InterruptedException e) {
                // Should not happen.
                throw new XBayaRuntimeException(e);
            } catch (InvocationTargetException e) {
                // Should not happen.
                throw new XBayaRuntimeException(e);
            }
        }

        final List<ComponentTreeNode> newSubTrees = new ArrayList<ComponentTreeNode>();
        for (ComponentRegistry registry : registries) {
View Full Code Here

                            "Cannot connect ports with different types.");
                }

            } else {
                // Should not happen.
                throw new XBayaRuntimeException("edges.size(): " + edges.size());
            }
        }
    }
View Full Code Here

          init();
        }
      });
    } catch (InterruptedException e) {
      // Shouldn't happen.
      throw new XBayaRuntimeException(e);
    } catch (InvocationTargetException e) {
      // Shouldn't happen.
      throw new XBayaRuntimeException(e);
    }
  }
View Full Code Here

       
      }
      inputs = workflow.getInputs();
      return inputs;
    } catch (GraphException e) {
      throw new XBayaRuntimeException(e);
    } catch (ComponentException e) {
      throw new XBayaRuntimeException(e);
    }

  }
View Full Code Here

      // necessary to create the other scripts
      // So send in some dummy URI for DSC
      URI dscUrl = XBayaConstants.DEFAULT_DSC_URL;
      return workflow.getOdeInvokableWSDL(dscUrl, odeEprEndingWithPort);
    } catch (Exception e) {
      throw new XBayaRuntimeException(e);
    }
  }
View Full Code Here

  public Object parseValue(WSComponentPort input, String valueString) {
    String name = input.getName();
    if (false) {
      // Some user wants to pass empty strings, so this check is disabled.
      if (valueString.length() == 0) {
        throw new XBayaRuntimeException(
            "Input parameter, " + name + ", cannot be empty");
      }
    }
    QName type = input.getType();
    Object value;
    if (LEADTypes.isKnownType(type)) {
      // TODO check the type.
      value = valueString;
    } else {
      try {
        value = XMLUtil.stringToXmlElement3(valueString);
      } catch (RuntimeException e) {
        throw new XBayaRuntimeException(
            "Input parameter, " + name + ", is not valid XML", e);
      }
    }
    return value;
  }
View Full Code Here

      for (WSComponentPort componentPort : inputs) {
        if (null == componentPort.getValue()) {
          if (null != componentPort.getDefaultValue()) {
            componentPort.setValue(componentPort.getDefaultValue());
          } else {
            throw new XBayaRuntimeException(
                "Workflow input cannot be null :"
                    + componentPort.getName());
          }
        }
        //This is a check that we do to make sure if the user didnt bother
        //to parse the input to a type like a xmlElement or an array we would
        // do it ourselves
        if(componentPort.getValue() instanceof String){
          componentPort.setValue(parseValue(componentPort, (String)componentPort.getValue()));
        }

      }

      GsiInvoker secureInvoker = null;
      secureInvoker = new GsiInvoker(credentials,
          XBayaSecurity.getTrustedCertificates());

      LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
          leadContext, null, secureInvoker);
      invoker.setInputs(inputs);
      final LEADWorkflowInvoker finalInvoker = invoker;

      new Thread() {
        public synchronized void run() {
          boolean success;
          try {
            success = finalInvoker.invoke();

            String result = null;
            if (success) {
              result = XmlConstants.BUILDER
                  .serializeToString(finalInvoker
                      .getOutputMessage());
            } else {
              result = XmlConstants.BUILDER
                  .serializeToString(finalInvoker
                      .getFaultMessage());
            }
          } catch (XBayaException e) {
            ODEClient.this.throwException(e);
          }
        }
      }.start();

    } catch (Exception e) {
      throw new XBayaRuntimeException(e);
    }

  }
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.XBayaRuntimeException

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.