Package org.apache.uima.pear.tools

Examples of org.apache.uima.pear.tools.InstallationController


    boolean done = pmController.mergePears();
    // check merging results
    Assert.assertTrue(done);
    Assert.assertTrue(outPearFile.isFile());
    // install the output PEAR file and check the results
    InstallationController insController = new InstallationController(OUT_PEAR_ID, outPearFile,
            _tempWorkingDir);
    InstallationDescriptor insDesc = insController.installComponent();
    Assert.assertTrue(insDesc != null);
    Assert.assertTrue(OUT_PEAR_ID.equals(insDesc.getMainComponentId()));
    // verify the installed component
    // customize ResourceManager by adding component CLASSPATH
    ResourceManager resMngr = UIMAFramework.newDefaultResourceManager();
View Full Code Here


      errorFlag = true;
      message = " terminated \n" + err.toString();
      printInConsole(errorFlag, message);
      return;
    }
    InstallationController installationController = new InstallationController(mainComponentId,
            localPearFile, installationDir);
    // adding installation controller message listener
    installationController.addMsgListener(new MessageRouter.StdChannelListener() {
      public void errMsgPosted(String errMsg) {
        printInConsole(true, errMsg);
      }

      public void outMsgPosted(String outMsg) {
        printInConsole(false, outMsg);
      }
    });
    insdObject = installationController.installComponent();
    if (insdObject == null) {
      runButton.setEnabled(false);
      /* installation failed */
      errorFlag = true;
      message = " \nInstallation of " + mainComponentId + " failed => \n "
              + installationController.getInstallationMsg();
      printInConsole(errorFlag, message);

    } else {
      try {

        /* save modified installation descriptor file */
        installationController.saveInstallationDescriptorFile();
        mainComponentRootPath = insdObject.getMainComponentRoot();
        errorFlag = false;
        message = " \nInstallation of " + mainComponentId + " completed \n";
        printInConsole(errorFlag, message);
        message = "The " + mainComponentRootPath + "/" + SET_ENV_FILE
                + " \n    file contains required " + "environment variables for this component\n";
        printInConsole(errorFlag, message);
        /* 2nd step: verification of main component installation */
        if (installationController.verifyComponent()) {
          // enable 'run' button only for AE
          File xmlDescFile = new File(insdObject.getMainComponentDesc());
          try {
            String uimaCompCtg = UIMAUtil.identifyUimaComponentCategory(xmlDescFile);
            if (UIMAUtil.ANALYSIS_ENGINE_CTG.equals(uimaCompCtg))
              runButton.setEnabled(true);
          } catch (Exception e) {
            // Ignore exceptions!
          }
          errorFlag = false;
          message = "Verification of " + mainComponentId + " completed \n";
          printInConsole(errorFlag, message);
        } else {
          runButton.setEnabled(false);
          errorFlag = true;
          message = "Verification of " + mainComponentId + " failed => \n "
                  + installationController.getVerificationMsg();
          printInConsole(errorFlag, message);
        }
      } catch (Exception exc) {
        errorFlag = true;
        message = "Error in InstallationController.main(): " + exc.toString();
        printInConsole(errorFlag, message);
      } finally {
        installationController.terminate();
      }
    }
  }
View Full Code Here

    boolean done = pmController.mergePears();
    // check merging results
    Assert.assertTrue(done);
    Assert.assertTrue(outPearFile.isFile());
    // install the output PEAR file and check the results
    InstallationController insController = new InstallationController(OUT_PEAR_ID, outPearFile,
            _tempWorkingDir);
    InstallationDescriptor insDesc = insController.installComponent();
    Assert.assertTrue(insDesc != null);
    Assert.assertTrue(OUT_PEAR_ID.equals(insDesc.getMainComponentId()));
    // verify the installed component
    // customize ResourceManager by adding component CLASSPATH
    ResourceManager resMngr = UIMAFramework.newDefaultResourceManager();
View Full Code Here

      errorFlag = true;
      message = " terminated \n" + err.toString();
      printInConsole(errorFlag, message);
      return;
    }
    InstallationController installationController = new InstallationController(mainComponentId,
            localPearFile, installationDir);
    // adding installation controller message listener
    installationController.addMsgListener(new MessageRouter.StdChannelListener() {
      public void errMsgPosted(String errMsg) {
        printInConsole(true, errMsg);
      }

      public void outMsgPosted(String outMsg) {
        printInConsole(false, outMsg);
      }
    });
    insdObject = installationController.installComponent();
    if (insdObject == null) {
      runButton.setEnabled(false);
      /* installation failed */
      errorFlag = true;
      message = " \nInstallation of " + mainComponentId + " failed => \n "
              + installationController.getInstallationMsg();
      printInConsole(errorFlag, message);

    } else {
      try {

        /* save modified installation descriptor file */
        installationController.saveInstallationDescriptorFile();
        mainComponentRootPath = insdObject.getMainComponentRoot();
        errorFlag = false;
        message = " \nInstallation of " + mainComponentId + " completed \n";
        printInConsole(errorFlag, message);
        message = "The " + mainComponentRootPath + "/" + SET_ENV_FILE
                + " \n    file contains required " + "environment variables for this component\n";
        printInConsole(errorFlag, message);
        /* 2nd step: verification of main component installation */
        if (installationController.verifyComponent()) {
          // enable 'run' button only for AE
          File xmlDescFile = new File(insdObject.getMainComponentDesc());
          try {
            String uimaCompCtg = UIMAUtil.identifyUimaComponentCategory(xmlDescFile);
            if (UIMAUtil.ANALYSIS_ENGINE_CTG.equals(uimaCompCtg))
              runButton.setEnabled(true);
          } catch (Exception e) {
            // Ignore exceptions!
          }
          errorFlag = false;
          message = "Verification of " + mainComponentId + " completed \n";
          printInConsole(errorFlag, message);
        } else {
          runButton.setEnabled(false);
          errorFlag = true;
          message = "Verification of " + mainComponentId + " failed => \n "
                  + installationController.getVerificationMsg();
          printInConsole(errorFlag, message);
        }
      } catch (Exception exc) {
        errorFlag = true;
        message = "Error in InstallationController.main(): " + exc.toString();
        printInConsole(errorFlag, message);
      } finally {
        installationController.terminate();
      }
    }
  }
View Full Code Here

      errorFlag = true;
      message = " terminated \n" + err.toString();
      printInConsole(errorFlag, message);
      return;
    }
    InstallationController installationController = new InstallationController(mainComponentId,
            localPearFile, installationDir);
    // adding installation controller message listener
    installationController.addMsgListener(new MessageRouter.StdChannelListener() {
      public void errMsgPosted(String errMsg) {
        printInConsole(true, errMsg);
      }

      public void outMsgPosted(String outMsg) {
        printInConsole(false, outMsg);
      }
    });
   
    insdObject = installationController.installComponent();
    if (insdObject == null) {
      /* installation failed */
      errorFlag = true;
      message = " \nInstallation of " + mainComponentId + " failed => \n "
              + installationController.getInstallationMsg();
      printInConsole(errorFlag, message);

    } else {
      try {

        /* save modified installation descriptor file */
        installationController.saveInstallationDescriptorFile();
        mainComponentRootPath = insdObject.getMainComponentRoot();
        errorFlag = false;
        message = " \nInstallation of " + mainComponentId + " completed \n";
        printInConsole(errorFlag, message);
        message = "The " + mainComponentRootPath + "/" + SET_ENV_FILE
                + " \n    file contains required " + "environment variables for this component\n";
        printInConsole(errorFlag, message);
        /* 2nd step: verification of main component installation */
        if (installationController.verifyComponent()) {
          errorFlag = false;
          message = "Verification of " + mainComponentId + " completed \n";
          printInConsole(errorFlag, message);
        } else {
          errorFlag = true;
          message = "Verification of " + mainComponentId + " failed => \n "
                  + installationController.getVerificationMsg();
          printInConsole(errorFlag, message);
        }
      } catch (Exception exc) {
        errorFlag = true;
        message = "Error in InstallationController.main(): " + exc.toString();
        printInConsole(errorFlag, message);
      } finally {
        installationController.terminate();
      }
    }
  }
View Full Code Here

    boolean done = pmController.mergePears();
    // check merging results
    Assert.assertTrue(done);
    Assert.assertTrue(outPearFile.isFile());
    // install the output PEAR file and check the results
    InstallationController insController = new InstallationController(OUT_PEAR_ID, outPearFile,
            _tempWorkingDir);
    InstallationDescriptor insDesc = insController.installComponent();
    Assert.assertTrue(insDesc != null);
    Assert.assertTrue(OUT_PEAR_ID.equals(insDesc.getMainComponentId()));
    // verify the installed component
    // customize ResourceManager by adding component CLASSPATH
    ResourceManager resMngr = UIMAFramework.newDefaultResourceManager();
View Full Code Here

      errorFlag = true;
      message = " terminated \n" + err.toString();
      printInConsole(errorFlag, message);
      return;
    }
    InstallationController installationController = new InstallationController(mainComponentId,
            localPearFile, installationDir);
    // adding installation controller message listener
    installationController.addMsgListener(new MessageRouter.StdChannelListener() {
      public void errMsgPosted(String errMsg) {
        printInConsole(true, errMsg);
      }

      public void outMsgPosted(String outMsg) {
        printInConsole(false, outMsg);
      }
    });
    insdObject = installationController.installComponent();
    if (insdObject == null) {
      runButton.setEnabled(false);
      /* installation failed */
      errorFlag = true;
      message = " \nInstallation of " + mainComponentId + " failed => \n "
              + installationController.getInstallationMsg();
      printInConsole(errorFlag, message);

    } else {
      try {

        /* save modified installation descriptor file */
        installationController.saveInstallationDescriptorFile();
        mainComponentRootPath = insdObject.getMainComponentRoot();
        errorFlag = false;
        message = " \nInstallation of " + mainComponentId + " completed \n";
        printInConsole(errorFlag, message);
        message = "The " + mainComponentRootPath + "/" + SET_ENV_FILE
                + " \n    file contains required " + "environment variables for this component\n";
        printInConsole(errorFlag, message);
        /* 2nd step: verification of main component installation */
        if (installationController.verifyComponent()) {
          // enable 'run' button only for AE
          File xmlDescFile = new File(insdObject.getMainComponentDesc());
          try {
            String uimaCompCtg = UIMAUtil.identifyUimaComponentCategory(xmlDescFile);
            if (UIMAUtil.ANALYSIS_ENGINE_CTG.equals(uimaCompCtg))
              runButton.setEnabled(true);
          } catch (Exception e) {
          }
          errorFlag = false;
          message = "Verification of " + mainComponentId + " completed \n";
          printInConsole(errorFlag, message);
        } else {
          runButton.setEnabled(false);
          errorFlag = true;
          message = "Verification of " + mainComponentId + " failed => \n "
                  + installationController.getVerificationMsg();
          printInConsole(errorFlag, message);
        }
      } catch (Exception exc) {
        errorFlag = true;
        message = "Error in InstallationController.main(): " + exc.toString();
        printInConsole(errorFlag, message);
      } finally {
        installationController.terminate();
      }
    }
  }
View Full Code Here

    boolean done = pmController.mergePears();
    // check merging results
    Assert.assertTrue(done);
    Assert.assertTrue(outPearFile.isFile());
    // install the output PEAR file and check the results
    InstallationController insController = new InstallationController(OUT_PEAR_ID, outPearFile,
            _tempWorkingDir);
    InstallationDescriptor insDesc = insController.installComponent();
    Assert.assertTrue(insDesc != null);
    Assert.assertTrue(OUT_PEAR_ID.equals(insDesc.getMainComponentId()));
    // verify the installed component
    // customize ResourceManager by adding component CLASSPATH
    ResourceManager resMngr = UIMAFramework.newDefaultResourceManager();
View Full Code Here

      errorFlag = true;
      message = " terminated \n" + err.toString();
      printInConsole(errorFlag, message);
      return;
    }
    InstallationController installationController = new InstallationController(mainComponentId,
            localPearFile, installationDir);
    // adding installation controller message listener
    installationController.addMsgListener(new MessageRouter.StdChannelListener() {
      public void errMsgPosted(String errMsg) {
        printInConsole(true, errMsg);
      }

      public void outMsgPosted(String outMsg) {
        printInConsole(false, outMsg);
      }
    });
    insdObject = installationController.installComponent();
    if (insdObject == null) {
      runButton.setEnabled(false);
      /* installation failed */
      errorFlag = true;
      message = " \nInstallation of " + mainComponentId + " failed => \n "
              + installationController.getInstallationMsg();
      printInConsole(errorFlag, message);

    } else {
      try {

        /* save modified installation descriptor file */
        installationController.saveInstallationDescriptorFile();
        mainComponentRootPath = insdObject.getMainComponentRoot();
        errorFlag = false;
        message = " \nInstallation of " + mainComponentId + " completed \n";
        printInConsole(errorFlag, message);
        message = "The " + mainComponentRootPath + "/" + SET_ENV_FILE
                + " \n    file contains required " + "environment variables for this component\n";
        printInConsole(errorFlag, message);
        /* 2nd step: verification of main component installation */
        if (installationController.verifyComponent()) {
          // enable 'run' button only for AE
          File xmlDescFile = new File(insdObject.getMainComponentDesc());
          try {
            String uimaCompCtg = UIMAUtil.identifyUimaComponentCategory(xmlDescFile);
            if (UIMAUtil.ANALYSIS_ENGINE_CTG.equals(uimaCompCtg))
              runButton.setEnabled(true);
          } catch (Exception e) {
            // Ignore exceptions!
          }
          errorFlag = false;
          message = "Verification of " + mainComponentId + " completed \n";
          printInConsole(errorFlag, message);
        } else {
          runButton.setEnabled(false);
          errorFlag = true;
          message = "Verification of " + mainComponentId + " failed => \n "
                  + installationController.getVerificationMsg();
          printInConsole(errorFlag, message);
        }
      } catch (Exception exc) {
        errorFlag = true;
        message = "Error in InstallationController.main(): " + exc.toString();
        printInConsole(errorFlag, message);
      } finally {
        installationController.terminate();
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.pear.tools.InstallationController

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.