/** * Checks if is primitive. * * @return true, if is primitive */ protected boolean isPrimitive() { return editor.getAeDescription().isPrimitive(); }
/** * Checks if is aggregate. * * @return true, if is aggregate */ public boolean isAggregate() { return isAeDescriptor() && (!aeDescription.isPrimitive()); }
/** * Checks if is primitive. * * @return true, if is primitive */ public boolean isPrimitive() { return isLocalProcessingDescriptor() && aeDescription.isPrimitive(); }
&& !((AnalysisEngineDescription) aDesc).isPrimitive()) { throw new IllegalArgumentException( "Only primitive meta collectors currently supported.");
&& !((AnalysisEngineDescription) aDesc).isPrimitive()) { throw new IllegalArgumentException( "Only primitive meta collectors currently supported.");
if (!((AnalysisEngineDescription) aDesc).isPrimitive()) { throw new IllegalArgumentException( "Only primitive meta collectors currently supported.");
if (!((AnalysisEngineDescription) aDesc).isPrimitive()) { throw new IllegalArgumentException( "Only primitive meta collectors currently supported.");
/** * This method simply calls {@link #add(String, AnalysisEngineDescription, String...)} using the * result of {@link AnalysisEngineDescription#getAnnotatorImplementationName()} for the component * name * * @param aed * an analysis engine description to add to the aggregate analysis engine * @param viewNames * pairs of view names corresponding to a componentSofaName followed by the * aggregateSofaName that it is mapped to. An even number of names must be passed in or * else an IllegalArgumentException will be thrown. See * {@link SofaMappingFactory#createSofaMapping(String, String, String)} * * @return the name of the component generated for the {@link AnalysisEngineDescription} */ public String add(AnalysisEngineDescription aed, String... viewNames) { String componentName = aed.getAnalysisEngineMetaData().getName(); if (componentName == null || componentName.equals("")) { if (aed.isPrimitive()) { componentName = aed.getAnnotatorImplementationName(); } else { componentName = "aggregate"; } } if (componentNames.contains(componentName)) { componentName = componentName + "." + (componentNames.size() + 1); } add(componentName, aed, viewNames); return componentName; }
Map<String, String> delegateParameterNames) { AnalysisEngineMetaData aggrMeta = aggrDesc.getAnalysisEngineMetaData(); if (aggrDesc.isPrimitive()) { throw new IllegalArgumentException(String.format( "The provided AE descriptor (name=%s) is primitive",
/** * Scan the given resource specifier for external resource dependencies and whenever a dependency * a compatible type is found, the given resource is bound to it. * * @param aDesc * a description. * @param aResDesc * the resource description. */ private static void bind(AnalysisEngineDescription aDesc, ExternalResourceDescription aResDesc) throws InvalidXMLException, ClassNotFoundException { // Recursively address delegates if (!aDesc.isPrimitive()) { for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { bindResource((ResourceSpecifier) delegate, aResDesc); } } // Bind if necessary Class<?> resClass = Class.forName(getImplementationName(aResDesc)); for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) { Class<?> apiClass = Class.forName(dep.getInterfaceName()); // Never bind fields of type Object. See also ExternalResourceInitializer#getApi() if (apiClass.equals(Object.class)) { continue; } if (apiClass.isAssignableFrom(resClass)) { bindExternalResource(aDesc, dep.getKey(), aResDesc); } } }
/** * Adds the delegate to GUI. * * @param keys the keys * @param newKey the new key * @param o the o */ private void addDelegateToGUI(String keys, String newKey, ResourceSpecifier o) { if (o instanceof AnalysisEngineDescription) { AnalysisEngineDescription aeDescription = (AnalysisEngineDescription) o; if (aeDescription.isPrimitive()) addPrimitiveToGUI(keys + newKey + "/", aeDescription); else { for (Iterator it = editor.getDelegateAEdescriptions(aeDescription).entrySet().iterator(); it .hasNext();) { Map.Entry item = (Map.Entry) it.next(); addDelegateToGUI(keys + newKey + "/", (String) item.getKey(), (ResourceSpecifier) item .getValue()); } FlowControllerDeclaration fcd = getFlowControllerDeclaration(); if (null != fcd) { addPrimitiveToGUI(keys + fcd.getKey() + "/", ((ResourceCreationSpecifier) editor .getResolvedFlowControllerDeclaration().getSpecifier())); } } } }
/** * Scan the given resource specifier for external resource dependencies and whenever a dependency * with the given key is encountered, the given resource is bound to it. * * @param aDesc * a description. * @param aKey * the key to bind to. * @param aResDesc * the resource description. */ private static void bind(AnalysisEngineDescription aDesc, String aKey, ExternalResourceDescription aResDesc) throws InvalidXMLException { // Recursively address delegates if (!aDesc.isPrimitive()) { for (Object delegate : aDesc.getDelegateAnalysisEngineSpecifiers().values()) { bindResource((ResourceSpecifier) delegate, aKey, aResDesc); } } // Bind if necessary for (ExternalResourceDependency dep : aDesc.getExternalResourceDependencies()) { if (aKey.equals(dep.getKey())) { bindExternalResource(aDesc, aKey, aResDesc); } } }
} else if (frameworkImpl.startsWith(Constants.JAVA_FRAMEWORK_NAME)) { if (spec instanceof AnalysisEngineDescription && !((AnalysisEngineDescription) spec).isPrimitive()) { resource = new AggregateAnalysisEngine_impl(); } else {
/** * Forces initialization of a Cas Pool if this is a Cas Multiplier delegate collocated with an * aggregate. The parent aggregate calls this method when all type systems have been merged. */ public synchronized void onInitialize() { // Component's Cas Pool is registered lazily, when the process() is called for // the first time. For monitoring purposes, we need the comoponent's Cas Pool // MBeans to register during initialization of the service. For a Cas Multiplier // force creation of the Cas Pool and registration of a Cas Pool with the JMX Server. // Just get the CAS and release it back to the component's Cas Pool. if (isCasMultiplier() && !isTopLevelComponent() ) { boolean isUimaAggregate = false; if ( !(resourceSpecifier instanceof CollectionReaderDescription) ) { // determine if this AE is a UIMA aggregate isUimaAggregate = ((AnalysisEngineDescription) resourceSpecifier).isPrimitive() == false ? true : false; } if ( !isUimaAggregate ) { // !uima core aggregate CM CAS cas = (CAS) getUimaContext().getEmptyCas(CAS.class); cas.release(); } } }
(! ((AnalysisEngineDescription)mDescription).isPrimitive())) { ((AnalysisEngineDescription)mDescription).isPrimitive()) { try { md.resolveImports();
private static void consolidateAggregate(AnalysisEngineDescription aDesc, ResourceManager aResMgr) throws ResourceInitializationException, InvalidXMLException { if (aDesc.isPrimitive() || aDesc.getDelegateAnalysisEngineSpecifiers().isEmpty()) { return;
resolvedFlowControllerDeclaration = aeDescription.getFlowControllerDeclaration(); setTypeSystemDescription(aeDescription.isPrimitive() ? md.getTypeSystem() : null);
&& !((AnalysisEngineDescription) aSpecifier).isPrimitive()) { return false;
/** * Validate. * * @throws ResourceInitializationException the resource initialization exception */ public void validate() throws ResourceInitializationException { AnalysisEngineDescription ae = (AnalysisEngineDescription) modelRoot.getAeDescription().clone(); // speedup = replace typeSystem with resolved imports version if (ae.isPrimitive()) { TypeSystemDescription tsd = modelRoot.getMergedTypeSystemDescription(); if (null != tsd) tsd = (TypeSystemDescription) tsd.clone(); ae.getAnalysisEngineMetaData().setTypeSystem(tsd); } ae.getAnalysisEngineMetaData().setFsIndexCollection(modelRoot.getMergedFsIndexCollection()); ae.getAnalysisEngineMetaData().setTypePriorities(modelRoot.getMergedTypePriorities()); try { // long time = System.currentTimeMillis(); // System.out.println("Creating TCas model"); cachedResult = modelRoot.createCas(ae, casCreateProperties, modelRoot.createResourceManager()); // System.out.println("Finished Creating TCas model; time= " + // (System.currentTimeMillis() - time)); if (null == cachedResult) throw new InternalErrorCDE("null result from createTCas"); } catch (CASAdminException e) { throw new ResourceInitializationException(e); } dirty = false; modelRoot.allTypes.dirty = true; }
if (analysisDesc.isPrimitive()) { engine = new PrimitiveAnalysisEngine_impl();