Package org.apache.uima.resource.metadata

Examples of org.apache.uima.resource.metadata.ResourceManagerConfiguration


                ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR, new Object[] {
                    name, metadata.getSourceUrlString() }, e);
      }

      // initialize any external resource declared in this descriptor
      ResourceManagerConfiguration resMgrCfg = ((ResourceCreationSpecifier) aSpecifier)
              .getResourceManagerConfiguration();
      if (resMgrCfg != null) {
        try {
          resMgrCfg.resolveImports(getResourceManager());
        } catch (InvalidXMLException e) {
          throw new ResourceInitializationException(e);
        }
        mUimaContextAdmin.getResourceManager().initializeExternalResources(resMgrCfg,
                mUimaContextAdmin.getQualifiedContextName(), aAdditionalParams);
View Full Code Here


      ExternalResourceDependency dep = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDependency();
      dep.setKey("ResourceKey");
      dep.setDescription("Test");
      mTestDesc.setExternalResourceDependencies(new ExternalResourceDependency[] { dep });
      ResourceManagerConfiguration resMgrCfg = UIMAFramework.getResourceSpecifierFactory()
              .createResourceManagerConfiguration();
      ExternalResourceDescription extRes = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDescription();
      extRes.setResourceSpecifier(uriSpec);
      extRes.setName("Resource1");
      extRes.setDescription("Test");
      resMgrCfg.setExternalResources(new ExternalResourceDescription[] { extRes });

      ExternalResourceBinding binding = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceBinding();
      binding.setKey("ResourceKey");
      binding.setResourceName("Resource1");
View Full Code Here

      ExternalResourceDependency dep = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDependency();
      dep.setKey("ResourceKey");
      dep.setDescription("Test");
      mTestDesc.setExternalResourceDependencies(new ExternalResourceDependency[] { dep });
      ResourceManagerConfiguration resMgrCfg = UIMAFramework.getResourceSpecifierFactory()
              .createResourceManagerConfiguration();
      ExternalResourceDescription extRes = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDescription();
      extRes.setResourceSpecifier(uriSpec);
      extRes.setName("Resource1");
      extRes.setDescription("Test");
      resMgrCfg.setExternalResources(new ExternalResourceDescription[] { extRes });

      ExternalResourceBinding binding = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceBinding();
      binding.setKey("ResourceKey");
      binding.setResourceName("Resource1");
View Full Code Here

   *
   * @throws InvalidXMLException
   */
  public void setResolvedExternalResourcesAndBindings() throws InvalidXMLException {
    AnalysisEngineDescription clonedAe = (AnalysisEngineDescription) aeDescription.clone();
    ResourceManagerConfiguration rmc = clonedAe.getResourceManagerConfiguration();
    if (null != rmc)
      rmc.resolveImports(createResourceManager());
    resolvedExternalResourcesAndBindings = rmc;
  }
View Full Code Here

      ExternalResourceDependency dep = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDependency();
      dep.setKey("ResourceKey");
      dep.setDescription("Test");
      aggregateDesc.setExternalResourceDependencies(new ExternalResourceDependency[] { dep });
      ResourceManagerConfiguration resMgrCfg = UIMAFramework.getResourceSpecifierFactory()
              .createResourceManagerConfiguration();
      ExternalResourceDescription extRes = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDescription();
      extRes.setResourceSpecifier(uriSpec);
      extRes.setName("Resource1");
      extRes.setDescription("Test");
      resMgrCfg.setExternalResources(new ExternalResourceDescription[] { extRes });
      ExternalResourceBinding binding = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceBinding();
      binding.setKey("ResourceKey");
      binding.setResourceName("Resource1");
      aggregateDesc.setResourceManagerConfiguration(resMgrCfg);
View Full Code Here

      ExternalResourceDependency dep = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDependency();
      dep.setKey("ResourceKey");
      dep.setDescription("Test");
      mTestDesc.setExternalResourceDependencies(new ExternalResourceDependency[] { dep });
      ResourceManagerConfiguration resMgrCfg = UIMAFramework.getResourceSpecifierFactory()
              .createResourceManagerConfiguration();
      ExternalResourceDescription extRes = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceDescription();
      extRes.setResourceSpecifier(uriSpec);
      extRes.setName("Resource1");
      extRes.setDescription("Test");
      resMgrCfg.setExternalResources(new ExternalResourceDescription[] { extRes });

      ExternalResourceBinding binding = UIMAFramework.getResourceSpecifierFactory()
              .createExternalResourceBinding();
      binding.setKey("ResourceKey");
      binding.setResourceName("Resource1");
View Full Code Here

            UIMAFramework.newConfigurationManager());
    // if CpeDescription contains a ResourceManagerConfiguration, parse it and use it
    // to configure the ResourceManager
    CpeResourceManagerConfiguration resMgrCfgDesc = aDescriptor.getResourceManagerConfiguration();
    if (resMgrCfgDesc != null) {
      ResourceManagerConfiguration resMgrCfg;
      try {
        if (resMgrCfgDesc.get().length() > 0) {
          String descriptorPath = CPMUtils.convertToAbsolutePath(System.getProperty("CPM_HOME"),
                  CPM_HOME, resMgrCfgDesc.get());
          resMgrCfg = UIMAFramework.getXMLParser().parseResourceManagerConfiguration(
View Full Code Here

  // **************************************************
  // * Common GUI state access
  // **************************************************

  public ResourceManagerConfiguration getResourceManagerConfiguration() {
    ResourceManagerConfiguration rmc = editor.getAeDescription().getResourceManagerConfiguration();
    if (null == rmc) {
      rmc = UIMAFramework.getResourceSpecifierFactory().createResourceManagerConfiguration();
      editor.getAeDescription().setResourceManagerConfiguration(rmc);
    }
    return rmc;
View Full Code Here

  private void resolveImport(URL aURL, Collection aAlreadyImportedURLs,
          Collection aResultResources, Collection aResultBindings, ResourceManager aResourceManager)
          throws InvalidXMLException, IOException {
    XMLInputSource input = new XMLInputSource(aURL);
    ResourceManagerConfiguration desc = UIMAFramework.getXMLParser()
            .parseResourceManagerConfiguration(input);
    desc.resolveImports(aAlreadyImportedURLs, aResourceManager);
    aResultResources.addAll(Arrays.asList(desc.getExternalResources()));
    aResultBindings.addAll(Arrays.asList(desc.getExternalResourceBindings()));
  }
View Full Code Here

    // Consolidate external resources
    Map<String, ExternalResourceDescription> resources = new LinkedHashMap<String, ExternalResourceDescription>();
    for (ResourceSpecifier delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) {
      AnalysisEngineDescription aeDelegate = (AnalysisEngineDescription) delegate;
      ResourceManagerConfiguration delegateResMgrCfg = aeDelegate.getResourceManagerConfiguration();
      for (ExternalResourceDescription res : delegateResMgrCfg.getExternalResources()) {
        resources.put(res.getName(), res);
      }

      delegateResMgrCfg.setExternalResources(null);
    }

    ResourceManagerConfiguration resMgrCfg = aDesc.getResourceManagerConfiguration();
    if (resMgrCfg == null) {
      resMgrCfg = UIMAFramework.getResourceSpecifierFactory().createResourceManagerConfiguration();
      aDesc.setResourceManagerConfiguration(resMgrCfg);
    }

    resMgrCfg.setExternalResources(resources.values().toArray(
            new ExternalResourceDescription[resources.size()]));
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.resource.metadata.ResourceManagerConfiguration

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.