Java Code Examples for org.apache.uima.resource.ResourceCreationSpecifier#setResourceManagerConfiguration()

The following examples show how to use org.apache.uima.resource.ResourceCreationSpecifier#setResourceManagerConfiguration() . 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: MultiPageEditor.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
/**
 * Link common collection descriptors from ae.
 *
 * @param r the r
 */
private void linkCommonCollectionDescriptorsFromAe(ResourceCreationSpecifier r) {
  r.setExternalResourceDependencies(aeDescription.getExternalResourceDependencies());
  r.setMetaData(convertFromAeMetaData((AnalysisEngineMetaData) aeDescription.getMetaData()));
  r.setResourceManagerConfiguration(aeDescription.getResourceManagerConfiguration());
}
 
Example 2
Source File: ExternalResourceFactory.java    From uima-uimafit with Apache License 2.0 3 votes vote down vote up
/**
 * Create a binding for the given external resource in the resource manager configuration of the
 * given resource. If no resource manager configuration exists yet, it will be created. This
 * method also scans the given external resource for any nested external resources and creates
 * bindings for them as well.
 * <p>
 * <b>NOTE:</b>IF you use this method with aggregate analysis engine descriptions because it will
 * <b>not have any effects on the delegate analysis engines</b> of the aggregate. If you want to
 * recursively bind an external resource to the delegates in an aggregate engine, use e.g.
 * {@link #bindResource(ResourceSpecifier, String, ExternalResourceDescription)}.
 * 
 * @param aDesc
 *          the specifier to create the binding in.
 * @param aBindTo
 *          what key to bind to.
 * @param aRes
 *          the resource that should be bound.
 */
public static void bindResourceOnce(ResourceCreationSpecifier aDesc, String aBindTo,
        ExternalResourceDescription aRes) {
  ResourceManagerConfiguration resMgrCfg = aDesc.getResourceManagerConfiguration();
  if (resMgrCfg == null) {
    resMgrCfg = new ResourceManagerConfiguration_impl();
    aDesc.setResourceManagerConfiguration(resMgrCfg);
  }

  bindResourceOnce(resMgrCfg, aBindTo, aRes);
}
 
Example 3
Source File: ExternalResourceFactory.java    From uima-uimafit with Apache License 2.0 3 votes vote down vote up
/**
 * Create a binding for the given external resource in resource manager configuration of the given
 * resource creation specified. If no resource manager configuration exists yet, it is created.
 * This method <b>does not</b> scan the given external resource for any nested external resources
 * and <b>does not</b> create bindings for them. Use
 * {@link #bindResourceOnce(ResourceCreationSpecifier, String, ExternalResourceDescription)} if
 * you wish to bind nested resources as well.
 * <p>
 * <b>NOTE:</b>If you use this method on an aggregate analysis engine description, it will <b>not
 * have any effects on the delegate analysis engines</b> of the aggregate. If you want to
 * recursively bind an external resource to the delegates in an aggregate engine, use e.g.
 * {@link #bindResource(ResourceSpecifier, String, ExternalResourceDescription)}.
 * 
 * @param aDesc
 *          the specifier to create the binding in.
 * @param aBindTo
 *          what key to bind to.
 * @param aRes
 *          the resource that should be bound.
 */
public static void bindResourceOnceWithoutNested(ResourceCreationSpecifier aDesc, String aBindTo, String aRes) {
  ResourceManagerConfiguration resMgrCfg = aDesc.getResourceManagerConfiguration();
  if (resMgrCfg == null) {
    resMgrCfg = new ResourceManagerConfiguration_impl();
    aDesc.setResourceManagerConfiguration(resMgrCfg);
  }

  bindResourceOnceWithoutNested(resMgrCfg, aBindTo, aRes);
}