/** * Create a ProcessTrace_impl using the framework's default timer. */ public ProcessTrace_impl() { this(UIMAFramework.getDefaultPerformanceTuningProperties()); }
/** * Create a ProcessTrace_impl with a custom timer. * * @param aTimer * the timer to use for collecting performance stats */ public ProcessTrace_impl(UimaTimer aTimer) { this(aTimer, UIMAFramework.getDefaultPerformanceTuningProperties()); }
/** * Create a ProcessTrace_impl with a custom timer. * * @param aTimer * the timer to use for collecting performance stats * @param aPerformanceTuningSettings * performance tuning settings. One of the settings allows the ProcessTrace to be * disabled. */ public ProcessTrace_impl(UimaTimer aTimer, Properties aPerformanceTuningSettings) { mTimer = aTimer; if (aPerformanceTuningSettings == null) { aPerformanceTuningSettings = UIMAFramework.getDefaultPerformanceTuningProperties(); } mEnabled = "true".equalsIgnoreCase(aPerformanceTuningSettings .getProperty(UIMAFramework.PROCESS_TRACE_ENABLED)); }
/** * Create a ProcessTrace_impl using the framework's default timer. * * @param aPerformanceTuningSettings * performance tuning settings. One of the settings allows the ProcessTrace to be * disabled. */ public ProcessTrace_impl(Properties aPerformanceTuningSettings) { // if (aPerformanceTuningSettings == null) { // aPerformanceTuningSettings = UIMAFramework.getDefaultPerformanceTuningProperties(); // } this("true".equalsIgnoreCase( ((aPerformanceTuningSettings == null) ? UIMAFramework.getDefaultPerformanceTuningProperties() : aPerformanceTuningSettings) .getProperty(UIMAFramework.PROCESS_TRACE_ENABLED))); }
/** * Initialize the pool. * * @param aNumInstances - * max size of the pool * @param aCasManager - * CAS Manager to use to create the CASes * @throws ResourceInitializationException - */ public CPECasPool(int aNumInstances, CasManager aCasManager) throws ResourceInitializationException { mNumInstances = aNumInstances; fillPool(aCasManager, UIMAFramework.getDefaultPerformanceTuningProperties()); }
/** * Instantiates and initializes CPE Factory with a given CPE Descriptor and defaults. * * @param aDescriptor - * parsed CPE descriptor * @throws Exception - */ public BaseCPMImpl(CpeDescription aDescriptor) throws Exception { this(aDescriptor, null, true, UIMAFramework.getDefaultPerformanceTuningProperties()); cpmThreadGroup = new CPMThreadGroup("CPM Thread Group"); }
/** * Creates a new CAS instance for an Analysis Engine. This works for both primitive and aggregate * analysis engines. * * @param aDescription * description of the analysis engine that will process this CAS. This is used to * set up the CAS's type system and indexes. * * @return a new CAS instance * * @throws ResourceInitializationException * if CAS creation fails */ public static CAS createCas(AnalysisEngineDescription aDescription) throws ResourceInitializationException { return createCas(aDescription, UIMAFramework.getDefaultPerformanceTuningProperties()); }
/** * Creates a new CAS instance for a collection of CAS Processors. This method correctly handles * aggregate as well as primitive analysis engines * <p> * If you pass this method objects of type {@link AnalysisEngineDescription}, * {@link CollectionReaderDescription}, {@link CasInitializerDescription}, or * {@link CasConsumerDescription}, it will not instantiate the components. It will just extract * the type system information from the descriptor. For any other kind of * {@link ResourceSpecifier}, it will call * {@link UIMAFramework#produceResource(org.apache.uima.resource.ResourceSpecifier, Map)}. For * example, if a {@link URISpecifier} is passed, a remote connection will be established and the * service will be queries for its metadata. An exception will be thrown if the connection can not * be opened. * * @param aComponentDescriptionsOrMetaData * a collection of {@link ResourceSpecifier}, {@link ProcessingResourceMetaData}, * {@link TypeSystemDescription}, {@link FsIndexCollection}, or * {@link TypePriorities} objects. * * @return a new CAS instance * * @throws ResourceInitializationException * if CAS creation fails */ public static CAS createCas(Collection<? extends MetaDataObject> aComponentDescriptionsOrMetaData) throws ResourceInitializationException { return createCas(aComponentDescriptionsOrMetaData, UIMAFramework .getDefaultPerformanceTuningProperties()); }
UIMAFramework.getDefaultPerformanceTuningProperties()); try { Class.forName(jdbcProperties.getProperty("db.driver"));
UIMAFramework.getDefaultPerformanceTuningProperties()); try { Class.forName(jdbcProperties.getProperty("db.driver"));
public void doFullValidation(ResourceManager aResourceManager) throws ResourceInitializationException { // check that user class was specified if (getImplementationName() == null || getImplementationName().length() == 0) { throw new ResourceInitializationException( ResourceInitializationException.MISSING_IMPLEMENTATION_CLASS_NAME, new Object[] { getSourceUrlString() }); } // try to load user class // use UIMA extension ClassLoader if available Class<?> implClass; try { implClass = Class_TCCL.forName(getImplementationName(), aResourceManager); } catch (ClassNotFoundException e) { throw new ResourceInitializationException(ResourceInitializationException.CLASS_NOT_FOUND, new Object[] { getImplementationName(), getSourceUrlString() }, e); } // verify the user class implements CollectionReader if (!CollectionReader.class.isAssignableFrom(implClass)) { throw new ResourceInitializationException( ResourceInitializationException.RESOURCE_DOES_NOT_IMPLEMENT_INTERFACE, new Object[] { getImplementationName(), CollectionReader.class.getName(), getSourceUrlString() }); } // try to create a CAS ArrayList<ProcessingResourceMetaData> metadata = new ArrayList<ProcessingResourceMetaData>(); metadata.add(getCollectionReaderMetaData()); CasCreationUtils.createCas(metadata, UIMAFramework.getDefaultPerformanceTuningProperties(), aResourceManager); }
/** * Parses CPE descriptor. * * @param mode - * indicates if the CPM should use a static descriptor or one provided * @param aDescriptor - * provided descriptor path * @param aResourceManager ResourceManager to be used by CPM * @throws Exception - */ public BaseCPMImpl(Boolean mode, String aDescriptor, ResourceManager aResourceManager) throws Exception { cpmThreadGroup = new CPMThreadGroup("CPM Thread Group"); cpeFactory = new CPEFactory(aResourceManager); if (mode == null) { defaultProcessTrace = true; cpeFactory.parse(); } else { defaultProcessTrace = mode.booleanValue(); cpeFactory.parse(aDescriptor); } init(mode == null, UIMAFramework.getDefaultPerformanceTuningProperties()); }
UIMAFramework.getDefaultPerformanceTuningProperties());
UIMAFramework.getDefaultPerformanceTuningProperties());