Codota Logo
UIMAFramework
Code IndexAdd Codota to your IDE (free)

How to use
UIMAFramework
in
org.apache.uima

Best Java code snippets using org.apache.uima.UIMAFramework (Showing top 20 results out of 540)

Refine searchRefine arrow

  • Logger
  • XMLInputSource
  • XMLParser
  • ConcurrentHashMap
  • LinkedList
  • ResourceInitializationException
  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: apache/tika

XMLInputSource aeIputSource = new XMLInputSource(aeDescriptorPath);
ResourceSpecifier aeSpecifier = UIMAFramework.getXMLParser()
    .parseResourceSpecifier(aeIputSource);
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aeSpecifier);
origin: org.apache.uima/uimaj-cpe

/**
 * Create a new CPEFactory on which we will later call parse(String) to parse a CPE descriptor.
 *
 * @param aResourceManager the a resource manager
 */
public CPEFactory(ResourceManager aResourceManager) {
 if (aResourceManager == null) {
  aResourceManager = UIMAFramework.newDefaultResourceManager();
 }
 uimaContext = UIMAFramework.newUimaContext(UIMAFramework.getLogger(), aResourceManager,
     UIMAFramework.newConfigurationManager());
}
origin: org.apache.uima/uimaj-ep-configurator

/**
 * Creates the fs index key description.
 *
 * @return the fs index key description
 */
public FsIndexKeyDescription createFsIndexKeyDescription() {
 return UIMAFramework.getResourceSpecifierFactory().createFsIndexKeyDescription();
}
origin: org.apache.ctakes/ctakes-utils

public static CollectionReader getCR(File collectionReaderDescriptorFile) throws ResourceInitializationException {
  try {
    XMLInputSource xmlInputSource = new XMLInputSource(collectionReaderDescriptorFile);
    XMLParser xmlParser = UIMAFramework.getXMLParser();
    ResourceSpecifier resourceSpecifier = xmlParser.parseResourceSpecifier(xmlInputSource);
    CollectionReader collectionReader = UIMAFramework.produceCollectionReader(resourceSpecifier);
    return collectionReader;
  } catch (IOException ioe) {
    throw new ResourceInitializationException(ioe);
  } catch (InvalidXMLException ixe) {
    throw new ResourceInitializationException(ixe);
  }
}
origin: org.apache.uima/uimaj-as-core

public void removeMessageOrigin(String aCasReferenceId) {
  if (originMap.containsKey(aCasReferenceId)) {
   originMap.remove(aCasReferenceId);
   if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
    UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(),
        "removeMessageOrigin", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
        "UIMAEE_remove_msg_origin_entry__FINEST",
        new Object[] { getComponentName(), aCasReferenceId });
   }
  }
}
origin: org.apache.uima/uimaj-cpe

/**
 * Disable a CASProcessor in the processing pipeline.
 *
 * @param aCasProcessorName          CASProcessor to be added to the processing pipeline
 */
public void enableCasProcessor(String aCasProcessorName) {
 for (int i = 0; i < annotatorList.size(); i++) {
  ProcessingContainer pc = ((ProcessingContainer) annotatorList.get(i));
  if (pc.getName().equals(aCasProcessorName)) {
   if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
    UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
        "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_enabled_cp__FINEST",
        new Object[] { Thread.currentThread().getName(), aCasProcessorName });
   }
   pc.setStatus(Constants.CAS_PROCESSOR_RUNNING);
  }
 }
}
origin: org.apache.uima/uimaj-cpe

/**
 * Checks out a CAS from the pool.
 * 
 * @return a CAS instance. Returns <code>null</code> if none are available (in which case the
 *         client may {@link Object#wait()} on this object in order to be notified when an
 *         instance becomes available).
 */
public synchronized CAS getCas() {
 if (!mFreeInstances.isEmpty()) {
  CAS cas = (CAS) mFreeInstances.remove(0);
  if (cas != null) {
   // Add the cas to a list of checked-out cases
   checkedOutInstances.add(cas);
   if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
    UIMAFramework.getLogger(this.getClass()).logrb(
        Level.FINEST,
        this.getClass().getName(),
        "process",
        CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
        "UIMA_CPM_add_cas_to_checkedout_list__FINEST",
        new Object[] { Thread.currentThread().getName(),
          String.valueOf(checkedOutInstances.size()) });
   }
  }
  return cas;
 } else {
  // no instances available
  return null;
 }
}
origin: org.apache.uima/uimaj-cpe

 if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
      "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
      "UIMA_CPM_add_consumer_to_list__CONFIG",
 ((List) consumerDeployList.get(listIndex)).add(aProcessor);
} else {
 ArrayList newList = new ArrayList();
 consumers.put(aCpName, newList);
 consumerDeployList.add(newList);
 if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
  UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
      "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
      "UIMA_CPM_add_consumer_to_new_list__CONFIG",
origin: org.apache.uima/uimaj-as-core

public synchronized void saveTime(long aTime, String aCasReferenceId, String anEndpointName) {
 String key = aCasReferenceId + anEndpointName;
 if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
  UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(), "saveTime",
      UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_save_time__FINE",
      new Object[] { aTime, aCasReferenceId, getComponentName(), anEndpointName, key });
 }
 statsMap.put(key, Long.valueOf(aTime));
}
origin: org.apache.uima/uimaj-as-core

protected void stopTransportLayer() {
 if (transports.size() > 0) {
  Set<Entry<String, UimaTransport>> set = transports.entrySet();
  for (Entry<String, UimaTransport> entry : set) {
   UimaTransport transport = entry.getValue();
   try {
    transport.stopIt();
   } catch (Exception e) {
    if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
     UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(),
         "stopTransportLayer", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
         "UIMAEE_service_exception_WARNING", getComponentName());
     UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(),
         "stopTransportLayer", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
         "UIMAEE_exception__WARNING", e);
    }
   }
  }
 }
}
origin: org.apache.uima/uimaj-cpe

Object anObject = queue.remove(aQueueIndex);
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
 UIMAFramework.getLogger(this.getClass()).logrb(Level.FINEST, this.getClass().getName(),
     "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
     "UIMA_CPM_chunk_state_false_timeout__FINEST",
origin: org.apache.uima/uimaj-cpe

 aResourceManager = UIMAFramework.newDefaultResourceManager();
uimaContext = UIMAFramework.newUimaContext(UIMAFramework.getLogger(), aResourceManager,
    UIMAFramework.newConfigurationManager());
   String descriptorPath = CPMUtils.convertToAbsolutePath(System.getProperty("CPM_HOME"),
       CPM_HOME, resMgrCfgDesc.get());
   resMgrCfg = UIMAFramework.getXMLParser().parseResourceManagerConfiguration(
       new XMLInputSource(descriptorPath));
   aResourceManager.initializeExternalResources(resMgrCfg, "/", null);
  throw new ResourceInitializationException(e);
 } catch (IOException e) {
  throw new ResourceInitializationException(e);
origin: org.apache.uima/uimaj-cpe

 if (anObject instanceof UimaTimer) {
  timer = (UimaTimer) anObject;
  if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
   UIMAFramework.getLogger(TimerFactory.class).logrb(Level.CONFIG,
       TimerFactory.class.getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
       "UIMA_CPM_show_timer_class__CONFIG",
 throw new ResourceInitializationException(ResourceInitializationException.CLASS_NOT_FOUND,
     new Object[] { aClassName, "CPE" }, e);
} catch (IllegalAccessException e) {
 throw new ResourceInitializationException(
     ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { aClassName,
       "CPE" }, e);
} catch (InstantiationException e) {
 throw new ResourceInitializationException(
     ResourceInitializationException.COULD_NOT_INSTANTIATE, new Object[] { aClassName,
       "CPE" }, e);
if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
 UIMAFramework.getLogger(TimerFactory.class).logrb(Level.CONFIG,
     TimerFactory.class.getName(), "initialize", CPMUtils.CPM_LOG_RESOURCE_BUNDLE,
     "UIMA_CPM_java_timer__CONFIG", new Object[] { Thread.currentThread().getName() });
origin: org.apache.uima/uimaj-as-core

 this.uimaLogger = UIMAFramework.getLogger(this.getClass());
 this.aeDesc = aeDescriptorFileName;
 this.numInstances = numInstances;
 this.uimaLogger.log(Level.INFO, "Starting C++ service: " + commandArgs.toString());
 this.uimaLogger.log(Level.INFO, " env params: " + envVarMap.toString());
 startService();
 throw new ResourceInitializationException(e);
} catch (UIMAException e) {
 notifyInitializationStatus(e);
 throw new ResourceInitializationException(e);
origin: org.apache.uima/uimafit-core

throw new ResourceInitializationException(e1);
  UIMAFramework.getLogger().logrb(Level.CONFIG, ResourceManager_impl.class.getName(),
      "initializeExternalResources", LOG_RESOURCE_BUNDLE,
      "UIMA_overridden_resource__CONFIG",
      new Object[] { e.getKey(), aQualifiedContextName, definingContext });
 } else {
  UIMAFramework.getLogger().logrb(Level.WARNING, ResourceManager_impl.class.getName(),
      "initializeExternalResources", LOG_RESOURCE_BUNDLE,
      "UIMA_duplicate_resource_name__WARNING",
throw new ResourceInitializationException(e1);
origin: org.apache.uima/uimafit-core

/**
 * Creates a {@link TypeSystemDescription} from all type descriptions that can be found via the
 * default import pattern or via the {@code META-INF/org.apache.uima.fit/types.txt} files in the
 * classpath.
 * 
 * @return the auto-scanned type system.
 * @throws ResourceInitializationException
 *           if the collected type system descriptions cannot be merged.
 */
public static TypeSystemDescription createTypeSystemDescription()
    throws ResourceInitializationException {
 List<TypeSystemDescription> tsdList = new ArrayList<TypeSystemDescription>();
 for (String location : scanTypeDescriptors()) {
  try {
   XMLInputSource xmlInputType1 = new XMLInputSource(location);
   tsdList.add(getXMLParser().parseTypeSystemDescription(xmlInputType1));
   LogFactory.getLog(TypeSystemDescription.class).debug(
       "Detected type system at [" + location + "]");
  } catch (IOException e) {
   throw new ResourceInitializationException(e);
  } catch (InvalidXMLException e) {
   LogFactory.getLog(TypeSystemDescription.class).warn(
       "[" + location + "] is not a type file. Ignoring.", e);
  }
 }
 ResourceManager resMgr = ResourceManagerFactory.newResourceManager();
 return mergeTypeSystems(tsdList, resMgr);
}
origin: org.apache.uima/uimafit-core

/**
 * Creates a {@link FsIndexCollection} from all index descriptions that can be found via the
 * pattern specified in the system property {@code org.apache.uima.fit.fsindex.import_pattern} or
 * via the {@code META-INF/org.apache.uima.fit/fsindexes.txt} files in the classpath.
 * 
 * @return the auto-scanned indexes.
 * @throws ResourceInitializationException
 *           if the index collection could not be assembled
 */
public static FsIndexCollection createFsIndexCollection() throws ResourceInitializationException {
 List<FsIndexDescription> fsIndexList = new ArrayList<FsIndexDescription>();
 for (String location : scanIndexDescriptors()) {
  try {
   XMLInputSource xmlInput = new XMLInputSource(location);
   FsIndexCollection fsIdxCol = getXMLParser().parseFsIndexCollection(xmlInput);
   fsIdxCol.resolveImports();
   fsIndexList.addAll(asList(fsIdxCol.getFsIndexes()));
   LogFactory.getLog(FsIndexFactory.class).debug("Detected index at [" + location + "]");
  } catch (IOException e) {
   throw new ResourceInitializationException(e);
  } catch (InvalidXMLException e) {
   LogFactory.getLog(FsIndexFactory.class).warn(
       "[" + location + "] is not a index descriptor file. Ignoring.", e);
  }
 }
 return createFsIndexCollection(fsIndexList.toArray(new FsIndexDescription[fsIndexList.size()]));
}
origin: org.dkpro.tc/dkpro-tc-ml

@Override
public void initialize(UimaContext context) throws ResourceInitializationException
{
  super.initialize(context);
  try {
    featureExtractors = new FeatureResourceLoader(tcModelLocation)
        .loadExternalResourceDescriptionOfFeatures();
    mlAdapter = initMachineLearningAdapter(tcModelLocation);
    featureMode = initFeatureMode(tcModelLocation);
    learningMode = initLearningMode(tcModelLocation);
    validateUimaParameter();
    AnalysisEngineDescription connector = getSaveModelConnector(
        tcModelLocation.getAbsolutePath(), mlAdapter, learningMode, featureMode,
        featureExtractors);
    engine = UIMAFramework.produceAnalysisEngine(connector,
        getModelFeatureAwareResourceManager(tcModelLocation), null);
  }
  catch (Exception e) {
    throw new ResourceInitializationException(e);
  }
}
origin: apache/uima-uimaj

  resMgr = UIMAFramework.newDefaultResourceManager();
 Logger logger = UIMAFramework.getLogger(this.getClass());
 logger.setResourceManager(resMgr);
  configMgr = UIMAFramework.newConfigurationManager();
 mUimaContextAdmin = UIMAFramework.newUimaContext(logger, resMgr, configMgr);
Logger logger = UIMAFramework.getLogger(this.getClass());
logger.setResourceManager(mUimaContextAdmin.getResourceManager());
mUimaContextAdmin.setLogger(logger);
 throw new ResourceInitializationException(e);
   externalOverrides = UIMAFramework.getResourceSpecifierFactory().createSettings();  // i.e. new Settings_impl()
   try {
    externalOverrides.loadSystemDefaults();
   } catch (ResourceConfigurationException e) {
    throw new ResourceInitializationException(ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR,
        new Object[] { name, metadata.getSourceUrlString() }, e);
 mUimaContextAdmin.getConfigurationManager().setSession(mUimaContextAdmin.getSession());
} catch (ResourceConfigurationException e) {
 throw new ResourceInitializationException(
     ResourceInitializationException.ERROR_INITIALIZING_FROM_DESCRIPTOR, new Object[] {
       name, metadata.getSourceUrlString() }, e);
origin: apache/uima-uimaj

  throw new ResourceInitializationException(
      ResourceInitializationException.NOT_A_FLOW_CONTROLLER_DESCRIPTOR, new Object[] {
        aSpecifier.getSourceUrlString(), aSpecifier.getClass().getName() });
 if (fwImpl == null
     || !fwImpl.equalsIgnoreCase(Constants.JAVA_FRAMEWORK_NAME)) {
  throw new ResourceInitializationException(
      ResourceInitializationException.UNSUPPORTED_FRAMEWORK_IMPLEMENTATION, new Object[] {
        fwImpl, aSpecifier.getSourceUrlString() });
 Logger logger = UIMAFramework.getLogger(mFlowController.getClass());
 logger.setResourceManager(this.getResourceManager());
 uimaContext.setLogger(logger);
 classLogger.logrb(Level.CONFIG, this.getClass().getName(), "initialize", LOG_RESOURCE_BUNDLE,
     "UIMA_flow_controller_init_begin__CONFIG", getMetaData().getName());
 classLogger.logrb(Level.CONFIG, this.getClass().getName(), "initialize", LOG_RESOURCE_BUNDLE,
     "UIMA_flow_controller_init_successful__CONFIG", getMetaData().getName());
 return true;
} catch (ResourceConfigurationException e) {
 throw new ResourceInitializationException(e);
} finally {
 UimaContextHolder.setContext(prevContext);
org.apache.uimaUIMAFramework

Javadoc

This is an application's main interface point to the UIMA Framework. Static methods on this class allow the application to create instances of UIMA components.

This class also provides the ability to change the underlying UIMA implementation. All UIMA implementations must provide a subclass of UIMAFramework as part of their distribution. If you wish to use a UIMA implementation other than the default reference implementation, set the System property uima.framework_impl to the fully qualified class name of the UIMAFramework subclass that you wish to use. Note that this must be done prior to loading this class. If the uima.framework_impl property has not been set when this class is loaded, the default reference implementation will be used.

Most used methods

  • getXMLParser
  • produceAnalysisEngine
  • newDefaultResourceManager
  • getLogger
  • getResourceSpecifierFactory
  • newConfigurationManager
  • newUimaContext
  • produceCollectionReader
  • produceCollectionProcessingEngine
    Produces a CollectionProcessingEngine instance from a cpeDescription.
  • getDefaultPerformanceTuningProperties
  • produceCasConsumer
  • getVersionString
  • produceCasConsumer,
  • getVersionString,
  • produceResource,
  • _getBuildRevision,
  • _getDefaultPerformanceTuningProperties,
  • _getLogger,
  • _getMajorVersion,
  • _getMinorVersion,
  • _getResourceFactory,
  • _getResourceSpecifierFactory

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now