Package org.apache.uima.resource

Examples of org.apache.uima.resource.ResourceSpecifier


      // create CPM instance that will drive processing
      mCPM = UIMAFramework.newCollectionProcessingManager();

      // read AE descriptor from file
      XMLInputSource in = new XMLInputSource(aeSpecifierFile);
      ResourceSpecifier aeSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);

      // create and configure CAS consumer that will write the output (in
      // XMI format)
      CasConsumerDescription casConsumerDesc = XmiWriterCasConsumer.getDescription();
      ConfigurationParameterSettings consumerParamSettings = casConsumerDesc.getMetaData()
View Full Code Here


   * @param aFileName
   * @return URISpecifier
   * @throws ResourceConfigurationException
   */
  private URISpecifier getURISpecifier(URL aDescriptorUrl) throws ResourceConfigurationException {
    ResourceSpecifier resourceSpecifier = getSpecifier(aDescriptorUrl);

    if (!(resourceSpecifier instanceof URISpecifier)) {
      throw new ResourceConfigurationException(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
              "UIMA_CPM_invalid_deployment__SEVERE", new Object[] {
                  Thread.currentThread().getName(), aDescriptorUrl, null });
View Full Code Here

  private CasProcessor produceIntegratedCasProcessor(URL aDescriptor)
          throws ResourceConfigurationException {
    CasProcessor casProcessor = null;
    try {
      if (aDescriptor != null) {
        ResourceSpecifier resourceSpecifier = cpeFactory.getSpecifier(aDescriptor);

        if (resourceSpecifier instanceof AnalysisEngineDescription) {
          casProcessor = UIMAFramework.produceAnalysisEngine(resourceSpecifier, this.cpeFactory
                  .getResourceManager(), null);
          // casProcessor.
View Full Code Here

   */
  public static String getProtocol(CpeCasProcessor aCasProcessorConfig, ResourceManager aResourceManager)
          throws ResourceConfigurationException {
    try {
      URL clientServiceDescriptor = aCasProcessorConfig.getCpeComponentDescriptor().findAbsoluteUrl(aResourceManager);
      ResourceSpecifier resourceSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
              new XMLInputSource(clientServiceDescriptor));
      if (resourceSpecifier instanceof URISpecifier) {
        return ((URISpecifier) resourceSpecifier).getProtocol();
      }
    } catch (Exception e) {
View Full Code Here

      if (!validArgs) {
        printUsageMessage();
      } else {
        // get Resource Specifier from XML file or TEAR
        XMLInputSource in = new XMLInputSource(taeDescriptor);
        ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);

        // create Text Analysis Engine and CAS here
        ae = UIMAFramework.produceAnalysisEngine(specifier);
        CAS CAS = ae.newCAS();
View Full Code Here

      ArrayList allCapabilities = new ArrayList();
      boolean isMultipleDeploymentAllowed = true;
      boolean modifiesCas = false;
      for (int i = 0; i < dlgInstDescs.length; i++) {
        lastInputNo = i + 1;
        ResourceSpecifier dlgSpecifier = retrieveDelegateSpecifier(aggRootDir, dlgInstDescs[i]);
        if (dlgSpecifier instanceof AnalysisEngineDescription) {
          // get AE metadata
          AnalysisEngineMetaData dlgAeMetadata = ((AnalysisEngineDescription) dlgSpecifier)
                  .getAnalysisEngineMetaData();
          // collect AE capabilities
View Full Code Here

    String aggRootDirPath = aggRootDir.getAbsolutePath().replace('\\', '/');
    String dlgDescPath = dlgInstDesc.getMainComponentDesc().replaceAll(
            PMControllerHelper.MAIN_ROOT_REGEX, StringUtil.toRegExpReplacement(aggRootDirPath));
    // parse component descriptor
    XMLInputSource xmlSource = null;
    ResourceSpecifier dlgSpecifier = null;
    try {
      xmlSource = new XMLInputSource(dlgDescPath);
      XMLParser xmlParser = UIMAFramework.getXMLParser();
      dlgSpecifier = xmlParser.parseResourceSpecifier(xmlSource);
    } catch (InvalidXMLException xmlExc) {
View Full Code Here

    assertTrue("Descriptor must exist: " + descriptorFile.getAbsolutePath(), descriptorFile
        .exists());

    try {
      XMLParser parser = UIMAFramework.getXMLParser();
      ResourceSpecifier spec = (ResourceSpecifier) parser.parse(new XMLInputSource(descriptorFile));
      this.ae = UIMAFramework.produceAnalysisEngine(spec);
    } catch (IOException e) {
      e.printStackTrace();
      assertTrue(false);
    } catch (InvalidXMLException e) {
View Full Code Here

      try {
         this.ae = null;
         // Create an XML input source from the specifier file.
         XMLInputSource in = new XMLInputSource(this.descFile);
         // Parse the specifier.
         ResourceSpecifier specifier = UIMAFramework.getXMLParser()
               .parseResourceSpecifier(in);
         // Create the Text Analysis Engine.
         this.ae = UIMAFramework.produceAnalysisEngine(specifier, this.mgr,
               null);
      } catch (Exception ex) {
View Full Code Here

      try {
         AnalysisEngine ae = null;
         // Create an XML input source from the specifier file.
         XMLInputSource in = new XMLInputSource(configDescFilePath);
         // Parse the specifier.
         ResourceSpecifier specifier = UIMAFramework.getXMLParser()
               .parseResourceSpecifier(in);
         // Create the Text Analysis Engine.
         ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);

         // Create a new CAS.
View Full Code Here

TOP

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

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.