Package org.apache.ode.tools

Examples of org.apache.ode.tools.ExecutionException


    _bpelFiles.add(u);
  }

  public void execute(CommandContext cc) throws ExecutionException {
    if (_bpelFiles.size() == 0) {
      throw new ExecutionException(__msgs.msgAtLeastOneProcessRequired());
    }

    if (_outputDir == null) {
      _outputDir = new File(SystemUtils.userDirectory());
    }

    _cc = cc;
    CompileListener myListener = new CompileListener() {

      public void onCompilationMessage(CompilationMessage m) {
        if (m.severity >= _minSeverity) {
          _cc.outln(m.toErrorString());
        }
        if (_compileListener != null) {
          _compileListener.onCompilationMessage(m);
        }
      }
    };

    URI u = null;

    if (_wsdlUri != null) {
      try {
        u = new URI(FileUtils.encodePath(_wsdlUri));
      }
      catch (URISyntaxException use) {
        throw new ExecutionException(__msgs.msgInvalidWsdlUrl(_wsdlUri));
      }
    }

    for (String bpelURI : _bpelFiles) {
      BpelC compiler = BpelC.newBpelCompiler();
      if (u != null) {
        compiler.setProcessWSDL(u);
      }
      compiler.setCompileListener(myListener);

      File bpelFile = new File(bpelURI);
      if (!bpelFile.exists()) {
        _cc.debug("File does not exist: " + bpelFile);
        throw new ExecutionException(__msgs.msgInvalidBpelUrl(bpelURI));
      }

      try {
        long start = System.currentTimeMillis();
        compiler.compile(bpelFile);
        long t = System.currentTimeMillis() - start;
        _cc.info("Compilation completed in " + t + "ms");
      }
      catch (IOException ioe) {
        throw new ExecutionException(__msgs.msgIoExReadingStreamWithMsg(bpelFile, ioe.getMessage()));
      } catch (CompilationException e) {
        throw new ExecutionException(e.toErrorMessage(), e);
      }
    }
  }
View Full Code Here


    _bpelFiles.add(u);
  }

  public void execute(CommandContext cc) throws ExecutionException {
    if (_bpelFiles.size() == 0) {
      throw new ExecutionException(__msgs.msgAtLeastOneProcessRequired());
    }

    if (_outputDir == null) {
      _outputDir = new File(SystemUtils.userDirectory());
    }

    _cc = cc;
    CompileListener myListener = new CompileListener() {

      public void onCompilationMessage(CompilationMessage m) {
        if (m.severity >= _minSeverity) {
          _cc.outln(m.toErrorString());
        }
        if (_compileListener != null) {
          _compileListener.onCompilationMessage(m);
        }
      }
    };

    URI u = null;

    if (_wsdlUri != null) {
      try {
        u = new URI(FileUtils.encodePath(_wsdlUri));
      }
      catch (URISyntaxException use) {
        throw new ExecutionException(__msgs.msgInvalidWsdlUrl(_wsdlUri));
      }
    }

    for (String bpelURI : _bpelFiles) {
      BpelC compiler = BpelC.newBpelCompiler();
      if (u != null) {
        compiler.setProcessWSDL(u);
      }
      compiler.setCompileListener(myListener);

      File bpelFile = new File(bpelURI);
      if (!bpelFile.exists()) {
        _cc.debug("File does not exist: " + bpelFile);
        throw new ExecutionException(__msgs.msgInvalidBpelUrl(bpelURI));
      }

      try {
        long start = System.currentTimeMillis();
        compiler.compile(bpelFile, BpelCompiler.getVersion(_outputDir.getAbsolutePath()));
        long t = System.currentTimeMillis() - start;
        _cc.info("Compilation completed in " + t + "ms");
      }
      catch (IOException ioe) {
        throw new ExecutionException(__msgs.msgIoExReadingStreamWithMsg(bpelFile, ioe.getMessage()));
      } catch (CompilationException e) {
        throw new ExecutionException(e.toErrorMessage(), e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ode.tools.ExecutionException

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.