Package org.apache.uima.resource

Examples of org.apache.uima.resource.ResourceManager


   * Create multiple processors which have to process multiple documents
   *
   * @throws Exception -
   */
  public void testCasPool() throws Exception {
    ResourceManager rm = UIMAFramework.newDefaultResourceManager();
   
    // check temporary working directory
    if (this.pearInstallDir == null)
      throw new FileNotFoundException("PEAR install directory not found");
   
View Full Code Here


      // start initialization timer  
      initTimer.start();
     
      // set datapath
      ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
      if (dataPath != null) {
        resMgr.setDataPath(dataPath);
      }

      AnalysisEngine ae = null;
      CAS cas = null;
      // get resource specifier from XML file
View Full Code Here

      throw new UIMA_IllegalStateException(UIMA_IllegalStateException.RESOURCE_ALREADY_INITIALIZED,
              new Object[] { getClass().getName() });
    }

    // get the ResourceManager (if any) supplied in the aAdditionalParams map
    ResourceManager resMgr = aAdditionalParams == null ? null : (ResourceManager) aAdditionalParams
            .get(Resource.PARAM_RESOURCE_MANAGER);

    // get performance tuning settings (if any) supplied in the aAdditionalParams map
    Properties perfSettings = aAdditionalParams == null ? null : (Properties) aAdditionalParams
            .get(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS);
View Full Code Here

      AnalysisEngineDescription aggregateSegDesc = UIMAFramework.getXMLParser()
              .parseAnalysisEngineDescription(
                      new XMLInputSource(JUnitExtension
                              .getFile("TextAnalysisEngineImplTest/AggregateWithSegmenter.xml")));
     
      ResourceManager rsrcMgr = UIMAFramework.newDefaultResourceManager();
      Map<String, Object> params = new HashMap<String, Object>();
      AnalysisEngine ae1 = UIMAFramework.produceAnalysisEngine(aggregateSegDesc, rsrcMgr, params);
      AnalysisEngine ae2 = UIMAFramework.produceAnalysisEngine(aggregateSegDesc, rsrcMgr, params);
     
      // start with testing first ae
View Full Code Here

    File datapath = new File(this.tempInstallDir, "uima.example.DateTimeAnnotator/my/test/data/path");
    File pearDatapath = new File(instPear.getComponentDataPath());
    Assert.assertEquals(datapath, pearDatapath);
       
    // Create resouce manager and set PEAR package classpath
    ResourceManager rsrcMgr = UIMAFramework.newDefaultResourceManager();

    // Create analysis engine from the installed PEAR package
    XMLInputSource in = new XMLInputSource(instPear.getComponentPearDescPath());
    ResourceSpecifier specifier = UIMAFramework.getXMLParser()
          .parseResourceSpecifier(in);
View Full Code Here

   * @return a ResourceManager object with the information from the PackageBrowser object.
   *
   * @throws IOException passthru
   */
  private static ResourceManager getResourceManager(PackageBrowser pkgBrowser) throws IOException {
    ResourceManager resourceMgr = UIMAFramework.newDefaultResourceManager();
    // set component data path
    if (pkgBrowser.getComponentDataPath() != null) {
      resourceMgr.setDataPath(pkgBrowser.getComponentDataPath());
    }
    // set component classpath
    if (pkgBrowser.buildComponentClassPath() != null) {
      resourceMgr.setExtensionClassPath(pkgBrowser.buildComponentClassPath(), true);
    }

    return resourceMgr;
  }
View Full Code Here

    if (fileName.charAt(0) == '.')
      fileName = fileName.substring(1);
    int partStart = 0;

    Import imp = UIMAFramework.getResourceSpecifierFactory().createImport();
    ResourceManager rm = editor.createResourceManager();

    for (;;) {
      imp.setName(fileName.substring(partStart));
      try {
        imp.findAbsoluteUrl(rm);
View Full Code Here

    }
  }

  protected boolean setupAE(File aeFile) {
    try {
      ResourceManager rsrcMgr = null;
      if (this.dataPathName != null) {
        try {
          rsrcMgr = UIMAFramework.newDefaultResourceManager();
          rsrcMgr.setDataPath(this.dataPathName);
        } catch (MalformedURLException e) {
          StringBuffer msg = new StringBuffer();
          msg.append("Error setting data path in AE,\n");
          msg.append("data path contains invalid URL or file descriptor.\n");
          msg.append("You can still run the AE if it doesn't rely on the data path.\n");
View Full Code Here

   * @return a ResourceManager object with the information from the PackageBrowser object.
   *
   * @throws IOException
   */
  private static ResourceManager getResourceManager(PackageBrowser pkgBrowser) throws IOException {
    ResourceManager resourceMgr = UIMAFramework.newDefaultResourceManager();
    // set component data path
    if (pkgBrowser.getComponentDataPath() != null) {
      resourceMgr.setDataPath(pkgBrowser.getComponentDataPath());
    }
    // set component classpath
    if (pkgBrowser.buildComponentClassPath() != null) {
      resourceMgr.setExtensionClassPath(pkgBrowser.buildComponentClassPath(), true);
    }

    return resourceMgr;
  }
View Full Code Here

      ByteArrayInputStream bais = new ByteArrayInputStream(bar);
      XMLInputSource in = new XMLInputSource(bais, null);
      ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
      bais.close();

      ResourceManager resMgr = UIMAFramework.newDefaultResourceManager();
      resMgr.setDataPath(dataPath);

      if (specifier instanceof CasConsumerDescription) {
        cc = UIMAFramework.produceCasConsumer(specifier);
        CasConsumerDescription ccdesc = (CasConsumerDescription) specifier;
        Capability[] capabilities = ccdesc.getCasConsumerMetaData().getCapabilities();
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.ResourceManager

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.