On Wed, Jun 4, 2008 at 8:42 PM, Richard Eckart
<[EMAIL PROTECTED]> wrote:
>> If you wanted your Collection Reader and CAS Consumer so share data
>> that was *not* related to a particular CAS, you could use UIMA's
>> external resource mechanism to accomplish that.
>
> I was originally searching for that (because it was mentioned at the
> UIMA workshop at the LREC) but I only found out how to use the session
> variables. Do you have a pointer to finding out how to use that mechanism?
>

The best place to start for learning about external resources is this
chapter of the tutorial:
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.accessing_external_resource_files

What may at first be confusing is that this is talking about sharing
access to a data file between components, whereas you don't have a
file.  But the same mechanism can be used without reading from a file.
 You could just use a dummy file, or you could use a
customResourceSpecifier instead of a fileResourceSpecifier, see:
http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/references/references.html#ugr.ref.xml.component_descriptor.custom_resource_specifiers

> What I want is that wherever I put the Java object, it should be
> automatically
> removed when a CAS is fully processed - no matter if it was successful or
> not.
> The object is bound to a document but representable in the CAS. Before I had
> an
> ID encoded in the CAS and passed the object out-of-band via a static hashmap
> (CollectionReader puts object there under the ID and CASConsumer reads it
> again).
> However I was not too happy with this solution. Would this scenario be
> solvable
> with the external resources approach?
>

I think you will still need a hashmap keyed on the ID encoded in the
CAS (since multiple CASes may be being processed concurrently), but
instead of making it static you can put it in your external resource
object that's then shared between your components.

-Adam

Reply via email to