org.apache.uima.UIMARuntimeException Java Examples

The following examples show how to use org.apache.uima.UIMARuntimeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlueAnnotationViewGenerator.java    From bluima with Apache License 2.0 6 votes vote down vote up
/**
    * Parses an XML file and produces a Templates object.
    * 
    * @param filename
    *            name of .xsl file, to be looked up in the classpath, under the
    *            same package as this class.
    * @return Templates object usable for XSL transformation
    */
   private Templates getTemplates(String filename) {
// InputStream is =
// AnnotationViewGenerator.class.getResourceAsStream(filename);
Templates templates;
InputStream is = null;
try {
    is = ResourceHelper.getInputStream("viewer/" + filename);
    templates = mTFactory.newTemplates(new StreamSource(is));
} catch (Exception e) {
    throw new UIMARuntimeException(e);
} finally {
    IOUtils.closeQuietly(is);
}
return templates;
   }
 
Example #2
Source File: UimaTypeSystem2Ecore.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Load uima builtins ecore.
 *
 * @param resourceSet the resource set
 * @param aSchemaLocationMap the a schema location map
 * @return the resource
 */
private static Resource loadUimaBuiltinsEcore(ResourceSet resourceSet, Map aSchemaLocationMap) {
  // load Ecore model for UIMA built-in types (use classloader to locate)
  URL uimaEcoreUrl = UimaTypeSystem2Ecore.class.getResource("/uima.ecore");
  if (uimaEcoreUrl == null) {
    throw new UIMARuntimeException(UIMARuntimeException.UIMA_ECORE_NOT_FOUND, new Object[0]);
  }
  Resource uimaEcoreResource = resourceSet.getResource(URI.createURI(uimaEcoreUrl.toString()),
          true);
  // register core UIMA packages (I'm surprised I need to do this manually)
  TreeIterator iter = uimaEcoreResource.getAllContents();
  while (iter.hasNext()) {
    Object current = iter.next();
    if (current instanceof EPackage) {
      EPackage pkg = (EPackage) current;
      EPackage.Registry.INSTANCE.put(pkg.getNsURI(), pkg);
      if (aSchemaLocationMap != null) {
        String schemaLoc = uimaEcoreResource.getURI() + "#"
                + uimaEcoreResource.getURIFragment(pkg);
        aSchemaLocationMap.put(pkg.getNsURI(), schemaLoc);
      }
    }
  }
  return uimaEcoreResource;
}
 
Example #3
Source File: XMLSerializer.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
public XMLSerializer(boolean isFormattedOutput) {
  try {
    mHandler = transformerFactory.newTransformerHandler();
    mTransformer = mHandler.getTransformer();

    if (isFormattedOutput) {
      // set default output format
      mTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
      mTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
      mTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
      //   Saxon appears to ignore the above and use a default of 3 unless the following is used
      //mTransformer.setOutputProperty("{http://saxon.sf.net/}indent-spaces", "4");
      //   But this fails on Saxon9-HE with:
      //     net.sf.saxon.trans.LicenseException: Requested feature (custom serialization) requires Saxon-PE
      mTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
    }

  } catch (TransformerConfigurationException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #4
Source File: CasCopier.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
   * Does a complete deep copy of one CAS into another CAS.  The contents of each view
   * in the source CAS will be copied to the same-named view in the destination CAS.  If
   * the view does not already exist it will be created.  All FeatureStructures that are
   * indexed in a view in the source CAS will become indexed in the same-named view in the
   * destination CAS. This version of the method supports a "lenient copy" option. When set,
   * the CAS copy function will ignore (not attempt to copy) FSs and features not defined in the type system
   * of the destination CAS, rather than throwing an exception.
   *
   * @param aSrcCas
   *          the CAS to copy from
   * @param aDestCas
   *          the CAS to copy to; must be a completely different CAS than the source (that is, not an alternative "view" of the source)
   * @param aCopySofa
   *          if true, the sofa data and mimeType of each view will be copied. If false they will not.
   * @param lenient
   *          ignore FSs and features not defined in the type system of the destination CAS
   */
  public static void copyCas(CAS aSrcCas, CAS aDestCas, boolean aCopySofa, boolean lenient) {
    CasCopier copier = new CasCopier(aSrcCas, aDestCas, lenient);
    
    // oops, this misses the initial view if a sofa FS has not yet been created
//    Iterator<SofaFS> sofaIter = aSrcCas.getSofaIterator();
//    while (sofaIter.hasNext()) {
//      SofaFS sofa = sofaIter.next();
//      CAS view = aSrcCas.getView(sofa);
//      copier.copyCasView(view, aCopySofa);
//    }
    
    if (copier.originalSrcCas.getBaseCAS() == copier.originalTgtCas.getBaseCAS()) {
      throw new UIMARuntimeException(UIMARuntimeException.ILLEGAL_CAS_COPY_TO_SAME_CAS);
    }
    
    Iterator<CAS> viewIterator = aSrcCas.getViewIterator();
    while (viewIterator.hasNext()) {
      CAS view = viewIterator.next();
      copier.copyCasView(view, aCopySofa); 

    }
  }
 
Example #5
Source File: CasManager_impl.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Gets a specified interface to a CAS.
 * 
 * @param cas
 *          The CAS
 * @param requiredInterface
 *          interface to get. Currently must be one of CAS or JCas.
 * @param <T> the particular interface
 * @return -         
 */
@SuppressWarnings("unchecked")
public static <T extends AbstractCas> T getCasInterfaceStatic(CAS cas, Class<T> requiredInterface) {
  if (requiredInterface == CAS.class) {
    return (T) cas;
  } else if (requiredInterface == JCas.class) {
    try {
      return (T) cas.getJCas();
    } catch (CASException e) {
      throw new UIMARuntimeException(e);
    }
  } else if (requiredInterface.isInstance(cas)) // covers AbstractCas
  {
    return (T) cas;
  }
  {
    throw new UIMARuntimeException(UIMARuntimeException.UNSUPPORTED_CAS_INTERFACE,
            new Object[] { requiredInterface });
  }
}
 
Example #6
Source File: CasManager_impl.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Gets a specified interface to a CAS.
 * 
 * @param cas
 *          The CAS
 * @param requiredInterface
 *          interface to get. Currently must be one of CAS or JCas.
 */
public AbstractCas getCasInterface(CAS cas, Class<? extends AbstractCas> requiredInterface) {
  if (requiredInterface == CAS.class) {
    return cas;
  } else if (requiredInterface == JCas.class) {
    try {
      return cas.getJCas();
    } catch (CASException e) {
      throw new UIMARuntimeException(e);
    }
  } else if (requiredInterface.isInstance(cas)) // covers AbstractCas
  {
    return cas;
  }
  {
    throw new UIMARuntimeException(UIMARuntimeException.UNSUPPORTED_CAS_INTERFACE,
            new Object[] { requiredInterface });
  }
}
 
Example #7
Source File: MetaDataObject_impl.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * @see org.apache.uima.resource.metadata.MetaDataObject#getAttributeValue(String)
 */
public Object getAttributeValue(String aName) {
  try {
    MetaDataAttr[] attrs = getUnfilteredAttributes();
    for (MetaDataAttr attr : attrs) {
      if (attr.name.equals(aName)) {
        Method reader = attr.reader;
        if (reader != null) {
          return reader.invoke(this);
        }
      }
    }
    return null;
  } catch (Exception e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #8
Source File: InstallationTester.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Creates new instance of the <code>InstallationTester</code> class, identifies a specified
 * component using UIMA API.
 * 
 * @param pkgBrowser
 *          packageBrowser object of an installed PEAR package
 * @throws java.io.IOException
 *           if any I/O exception occurred.
 * @throws org.apache.uima.util.InvalidXMLException
 *           if component descriptor is invalid.
 * @throws org.apache.uima.resource.ResourceInitializationException
 *           if the specified component cannot be instantiated.
 * @throws org.apache.uima.UIMAException
 *           if this exception occurred while identifying UIMA component category.
 * @throws org.apache.uima.UIMARuntimeException
 *           if this exception occurred while identifying UIMA component category.
 */
public InstallationTester(PackageBrowser pkgBrowser) throws IOException, InvalidXMLException,
        ResourceInitializationException, UIMAException, UIMARuntimeException {

  // set PackageBrowser
  this.pkgBrowser = pkgBrowser;

  // save System properties
  this.systemProps = System.getProperties();

  // check UIMA category of the main component
  File compDescFile = new File(this.pkgBrowser.getInstallationDescriptor().getMainComponentDesc());
  this.uimaCategory = UIMAUtil.identifyUimaComponentCategory(compDescFile);
  if (uimaCategory == null) {
    Exception err = UIMAUtil.getLastErrorForXmlDesc(compDescFile);
    if (err != null) {
      if (err instanceof UIMAException)
        throw (UIMAException) err;
      else if (err instanceof UIMARuntimeException)
        throw (UIMARuntimeException) err;
      else
        throw new RuntimeException(err);
    }
  }
}
 
Example #9
Source File: CASImpl.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
private void featModWhileInIndexReport(FeatureStructure fs, FeatureImpl fi) {
  // prepare a message which includes the feature which is a key, the fs, and
  // the call stack.
  StringWriter sw = new StringWriter();
  PrintWriter pw = new PrintWriter(sw);
  new Throwable().printStackTrace(pw);
  pw.close();
  String msg = String.format(
      "While FS was in the index, the feature \"%s\""
      + ", which is used as a key in one or more indexes, "
      + "was modified\n FS = \"%s\"\n%s%n",
      (fi == null)? "for-all-features" : fi.getName(),
      fs.toString(),  
      sw.toString());        
  UIMAFramework.getLogger().log(Level.WARNING, msg);
  
  if (IS_THROW_EXCEPTION_CORRUPT_INDEX) {
    throw new UIMARuntimeException(UIMARuntimeException.ILLEGAL_FS_FEAT_UPDATE, new Object[]{});
  }        
}
 
Example #10
Source File: XmiCasSerializer.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Write the CAS data to a SAX content handler.
 * 
 * @param cas
 *          The CAS to be serialized.
 * @param contentHandler
 *          The SAX content handler the data is written to.
 * @param errorHandler the SAX Error Handler to use
 * @param sharedData
 *          data structure used to allow the XmiCasSerializer and XmiCasDeserializer to share
 *          information.
 * @param marker
 *        an object used to filter the FSs and Views to determine if these were created after
 *          the mark was set. Used to serialize a Delta CAS consisting of only new FSs and views and
 *          preexisting FSs and Views that have been modified.
 *          
 * @throws SAXException if there was a SAX exception
 */
public void serialize(CAS cas, ContentHandler contentHandler, ErrorHandler errorHandler,
        XmiSerializationSharedData sharedData, Marker marker) throws SAXException {
  
  contentHandler.startDocument();
  if (errorHandler != null) {
    css.setErrorHandler(errorHandler);
  }
  XmiDocSerializer ser = new XmiDocSerializer(contentHandler, ((CASImpl) cas).getBaseCAS(), sharedData, (MarkerImpl) marker);
  try {
    ser.cds.serialize();
  } catch (Exception e) {
    if (e instanceof SAXException) {
      throw (SAXException) e;
    } else {
      throw new UIMARuntimeException(e);
    }
  }  
  contentHandler.endDocument();
}
 
Example #11
Source File: CpmPanel.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Displays an error message to the user.
 * 
 * @param aThrowable
 *          Throwable whose message is to be displayed.
 */
public void displayError(Throwable aThrowable) {
  aThrowable.printStackTrace();

  String message = aThrowable.toString();

  // For UIMAExceptions or UIMARuntimeExceptions, add cause info.
  // We have to go through this nonsense to support Java 1.3.
  // In 1.4 all exceptions can have a cause, so this wouldn't involve
  // all of this typecasting.
  while ((aThrowable instanceof UIMAException) || (aThrowable instanceof UIMARuntimeException)) {
    if (aThrowable instanceof UIMAException) {
      aThrowable = ((UIMAException) aThrowable).getCause();
    } else if (aThrowable instanceof UIMARuntimeException) {
      aThrowable = ((UIMARuntimeException) aThrowable).getCause();
    }

    if (aThrowable != null) {
      message += ("\nCausedBy: " + aThrowable.toString());
    }
  }

  displayError(message);
}
 
Example #12
Source File: AnnotationViewerMain.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Displays an error message to the user.
 * 
 * @param aThrowable
 *          Throwable whose message is to be displayed.
 */
public void displayError(Throwable aThrowable) {
  aThrowable.printStackTrace();

  String message = aThrowable.toString();

  // For UIMAExceptions or UIMARuntimeExceptions, add cause info.
  // We have to go through this nonsense to support Java 1.3.
  // In 1.4 all exceptions can have a cause, so this wouldn't involve
  // all of this typecasting.
  while ((aThrowable instanceof UIMAException) || (aThrowable instanceof UIMARuntimeException)) {
    if (aThrowable instanceof UIMAException) {
      aThrowable = ((UIMAException) aThrowable).getCause();
    } else if (aThrowable instanceof UIMARuntimeException) {
      aThrowable = ((UIMARuntimeException) aThrowable).getCause();
    }

    if (aThrowable != null) {
      message += ("\nCausedBy: " + aThrowable.toString());
    }
  }

  displayError(message);
}
 
Example #13
Source File: CPEFactory.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Creates an object representation for configuration in a given cpe descriptor file.
 * 
 * @param aDescriptor -
 *          path to the descriptor
 * 
 * @throws InstantiationException -
 */
public void parse(String aDescriptor) throws InstantiationException {
  defaultConfig = false;

  if (aDescriptor == null || aDescriptor.trim().length() == 0) {
    throw new UIMARuntimeException(new FileNotFoundException(CpmLocalizedMessage
            .getLocalizedMessage(CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
                    "UIMA_CPM_EXP_no_cpe_descriptor__WARNING", new Object[] { Thread
                            .currentThread().getName() })));
  }

  try {
    setCpeDescriptor(CpeDescriptorFactory.produceDescriptor(new FileInputStream(new File(
            aDescriptor))));

  } catch (Exception e) {
    throw new UIMARuntimeException(InvalidXMLException.INVALID_DESCRIPTOR_FILE,
            new Object[] { aDescriptor }, e);
  }
}
 
Example #14
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * The classloader to use in decompiling, if it is provided, is one that delegates first
 * to the parent.  This may need fixing for PEARs
 * @return classloader to use for migrate decompiling
 */
private ClassLoader getClassLoader(String pearClasspath) {
  if (null == pearClasspath) {
    if (null == cachedMigrateClassLoader) {
      cachedMigrateClassLoader = (null == migrateClasspath)
                      ? this.getClass().getClassLoader()
                      : new UIMAClassLoader(Misc.classpath2urls(migrateClasspath));
    }
    return cachedMigrateClassLoader;
  } else {
    try {
      return new UIMAClassLoader((null == migrateClasspath) 
                                   ? pearClasspath
                                   : (pearClasspath + File.pathSeparator + migrateClasspath));
    } catch (MalformedURLException e) {
      throw new UIMARuntimeException(e);
    }
  }
}
 
Example #15
Source File: AnnotationViewerDialog.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Displays an error message to the user.
 * 
 * @param aThrowable
 *          Throwable whose message is to be displayed.
 */
public void displayError(Throwable aThrowable) {
  aThrowable.printStackTrace();

  String message = aThrowable.toString();

  // For UIMAExceptions or UIMARuntimeExceptions, add cause info.
  // We have to go through this nonsense to support Java 1.3.
  // In 1.4 all exceptions can have a cause, so this wouldn't involve
  // all of this typecasting.
  while ((aThrowable instanceof UIMAException) || (aThrowable instanceof UIMARuntimeException)) {
    if (aThrowable instanceof UIMAException) {
      aThrowable = ((UIMAException) aThrowable).getCause();
    } else if (aThrowable instanceof UIMARuntimeException) {
      aThrowable = ((UIMARuntimeException) aThrowable).getCause();
    }

    if (aThrowable != null) {
      message += ("\nCausedBy: " + aThrowable.toString());
    }
  }

  displayError(message);
}
 
Example #16
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
private void pprintRoots(String kind, Container[] roots) {
  if (roots != null && roots.length > 0) {
    try {
      try (BufferedWriter bw = Files.newBufferedWriter(makePath(outDirLog + "ItemsProcessed"), StandardOpenOption.CREATE)) {
        logPrintNl(kind + " Roots:", bw);
        indent[0] += 2;
        try {
        for (Container container : roots) {
          pprintContainer(container, bw);
        }
        logPrintNl("", bw);
        } finally {
          indent[0] -= 2;
        }
      }
    } catch (IOException e) {
      throw new UIMARuntimeException(e);
    }
  }
}
 
Example #17
Source File: CPEFactory.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Creates an object representation for configuration in a given stream.
 *
 * @param aDescriptorStream -
 *          stream containing cpe description
 * @throws InstantiationException -
 */
public void parse(InputStream aDescriptorStream) throws InstantiationException {
  defaultConfig = false;

  if (aDescriptorStream == null) {
    throw new UIMARuntimeException(new IOException(CpmLocalizedMessage.getLocalizedMessage(
            CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
            "UIMA_CPM_EXP_invalid_cpe_descriptor_stream__WARNING", new Object[] { Thread
                    .currentThread().getName() })));
  }

  try {
    setCpeDescriptor(CpeDescriptorFactory.produceDescriptor(aDescriptorStream));
  } catch (Exception e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #18
Source File: DocumentAnalyzer.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * Displays an error message to the user.
 * 
 * @param aThrowable
 *          Throwable whose message is to be displayed.
 */
public void displayError(Throwable aThrowable) {
  aThrowable.printStackTrace();

  String message = aThrowable.toString();

  // For UIMAExceptions or UIMARuntimeExceptions, add cause info.
  // We have to go through this nonsense to support Java 1.3.
  // In 1.4 all exceptions can have a cause, so this wouldn't involve
  // all of this typecasting.
  while ((aThrowable instanceof UIMAException) || (aThrowable instanceof UIMARuntimeException)) {
    if (aThrowable instanceof UIMAException) {
      aThrowable = ((UIMAException) aThrowable).getCause();
    } else if (aThrowable instanceof UIMARuntimeException) {
      aThrowable = ((UIMARuntimeException) aThrowable).getCause();
    }

    if (aThrowable != null) {
      message += ("\nCausedBy: " + aThrowable.toString());
    }
  }

  displayError(message);
}
 
Example #19
Source File: XMLSerializer.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public void setOutputProperty(String name, String value) {
  try {
    mTransformer.setOutputProperty(name, value);
  } catch (IllegalArgumentException e) {
    throw new UIMARuntimeException(e);
  }
  //re-create the Result object when properties change.  This fixes bug UIMA-1859 where setting the XML version was
  //not reflected in the output.
  Result result = createSaxResultObject();
  if (result != null) {
    mHandler.setResult(result);
  }
}
 
Example #20
Source File: MigrateJCas.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
private static void withIOX(Runnable_withException r) {
  try {
    r.run();
  } catch (Exception e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #21
Source File: DataResource_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public URI getUri() {
  try {
    return UriUtils.quote(mFileUrl);
  } catch (URISyntaxException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #22
Source File: AnalysisComponent_ImplBase.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the UimaContext for this AnalysisComponent. This provides access to configuration
 * parameters and external resources.
 * 
 * @return the UimaContext for this AnalysisComponent
 */
protected final UimaContext getContext() {
  if (null == mContext) {
    // wrapped in RuntimeException because we don't want to change the API of this method
    throw new UIMARuntimeException(UIMARuntimeException.UIMA_CONTEXT_NULL, new Object[] {} );
  }    
  return mContext;
}
 
Example #23
Source File: CasCopier.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
private void copyCasViewDifferentCASs(CAS aSrcCasView, CAS aTgtCasView, boolean aCopySofa) {
  if (originalSrcCas.getBaseCAS() == originalTgtCas.getBaseCAS()) {
    throw new UIMARuntimeException(UIMARuntimeException.ILLEGAL_CAS_COPY_TO_SAME_CAS);
  }

  copyCasView(aSrcCasView, aTgtCasView, aCopySofa);
}
 
Example #24
Source File: XMLSerializer.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public void serialize(Node node) {
  try {
    mTransformer.transform(new DOMSource(node), createSaxResultObject());
  } catch (TransformerException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #25
Source File: XMLSerializer.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public void dom2sax(Node node, ContentHandler handler) {
  try {
    mTransformer.transform(new DOMSource(node), new SAXResult(handler));
  } catch (TransformerException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #26
Source File: BaseCPMImpl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a Collection Reader for this CPE.
 * 
 * @return the collection reader
 */
@Override
public BaseCollectionReader getCollectionReader() {
  try {
    if (this.collectionReader == null) {
      this.collectionReader = this.cpeFactory.getCollectionReader();
    }
    return this.collectionReader;
  } catch (ResourceConfigurationException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #27
Source File: XMLInputSource.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Creates an XMLInputSource from an existing InputStream.
 * 
 * @param aInputStream
 *          input stream from which to read
 * @param aRelativePathBase
 *          base for resolving relative paths. This must be a directory.
 */
public XMLInputSource(InputStream aInputStream, File aRelativePathBase) {
  mInputStream = aInputStream;
  try {
    mURL = aRelativePathBase == null ? null : aRelativePathBase.toURL();
  } catch (MalformedURLException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #28
Source File: AnalysisEngineServiceAdapter.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * @see org.apache.uima.resource.Resource#getMetaData()
 */
public ResourceMetaData getMetaData() {
  try {
    if (mCachedMetaData == null && getStub() != null) {
      mCachedMetaData = getStub().callGetMetaData();
    }
    return mCachedMetaData;
  } catch (ResourceServiceException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #29
Source File: UimacppAnalysisEngineImpl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated
 * @return -
 */
@Deprecated
protected AnalysisProcessData_impl createAnalysisProcessData() {
  try {
    return new AnalysisProcessData_impl(newCAS(), getPerformanceTuningSettings());
  } catch (ResourceInitializationException e) {
    throw new UIMARuntimeException(e);
  }
}
 
Example #30
Source File: UimacppAnalysisEngineImpl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * For an aggregate AnalysisEngine only, gets a Map from each component's key to the specifier for
 * that component.
 * 
 * @return a Map with String keys and ResourceSpecifier values
 */
protected Map<String, ResourceSpecifier> _getComponentCasProcessorSpecifierMap() {
  try {
    return ((AnalysisEngineDescription)mDescription).getDelegateAnalysisEngineSpecifiers();
  } catch (InvalidXMLException e) {
    // this should not happen, because we resolve delegates during
    // initialization
    throw new UIMARuntimeException(e);
  }
}