Christoph, you can use this API

public BaseCollectionReader getCollectionReader()

on the CPE to get the collection reader and you can call close() from your
code.
I'd suggest to do this in the
StatusCallbackListener.collectionProcessingComplete()
method.

You can plug in a custom listener using this API:

  public void addStatusCallbackListener(StatusCallbackListener aListener)

Jerry C


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jerry Cwiklik
 UIMA Extensions
 IBM T.J.  Watson Research Center
 Hawtorne, NY, 10532
 Tel: 914-784-7665,  T/L: 863-7665
 Email: [EMAIL PROTECTED]



                                                                       
             Christoph Büscher                                       
             <christoph.buesch                                         
             [EMAIL PROTECTED]>                                            To
                                       [email protected]  
             04/09/2008 05:22                                           cc
             AM                                                        
                                                                   Subject
                                       Re: Programmatically pausing and
             Please respond to         resuming CPE                    
             [EMAIL PROTECTED]                                         
               or.apache.org                                           
                                                                       
                                                                       
                                                                       
                                                                       




Hi Jaroslaw,

thanks a lot, that was exactly the information I was looking for.
I
  still have one more question Is there something similar to
"collectionProcessComplete()" for a CollectionReader? I would like to store
the
information about the last document read to disk when a user stops the CPE
before the whole processing of a directory is complete. I tried overwriting

"BaseCollectionReader.close()" in my CollectionReader, this doesn't seem to
get
called then the CPE is stopped. I start my CPE by reading a CPE-Descriptor,
then
simply start it like this:

cpe = UIMAFramework.produceCollectionProcessingEngine(cpeDesc);
cpe.process();

Shouldn't the framework call the readers "close()"-method when stopping the
CPE?
Or am I missing something here.

Thanks again,

Christoph


Jaroslaw Cwiklik schrieb:
> Christoph, the CPE creates multiple threads when it starts up.
> One thread is dedicated to a CollectionReader which produces
> CASes. Another thread contains the Analytics, and finally there is a
> thread with Cas Consumers.
> All of these threads run asynchronously. In their run() method each
> thread checks the state of the CPE and blocks
> if the state=pause. There are no explicit notifications done on the CR
> or AEs or CCs for pause/resume. Each thread
> blocks until an application calls resume().
>
> When a stop is called, the CPE calls collectionProcessComplete() on each
> CasProcessor and AE, in this AE method you can flush the current state
> to disk.
>
> JC
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Jerry Cwiklik
> UIMA Extensions
> IBM T.J. Watson Research Center
> Hawtorne, NY, 10532
> Tel: 914-784-7665, T/L: 863-7665
> Email: [EMAIL PROTECTED]
>
> Inactive hide details for Christoph Büscher
> <[EMAIL PROTECTED]>Christoph Büscher
> <[EMAIL PROTECTED]>
>
>
>                         *Christoph Büscher
>                         <[EMAIL PROTECTED]>*
>
>                         04/07/2008 05:55 AM
>                         Please respond to
>                         [email protected]
>
>
>

--
--------------------------------
Christoph Büscher

Reply via email to