Hi

I do exactly what Thilo suggested in a Web Service and it works like a charm.
I just would like to add that a simple load balancing is possible even with 
this solution : if you deploy several instances of your AE as Vinci services, 
the Vinci Naming Service (VNS) will randomly select which instance is going to 
be used to process the CAS

My 2 cts

Olivier

> -----Message d'origine-----
> De : Christoph Büscher [mailto:[EMAIL PROTECTED] 
> Envoyé : vendredi 15 février 2008 16:23
> À : [email protected]
> Objet : Re: How to "push" documents into CPE/CollectionReader?
> 
> Thanks Thilo,
> 
> this sound like a good thing to try. I thought that I need to 
> start a whole CPE because maybe the framework is needed to 
> set up the initial CAS that is passed on the the readers 
> "getNext()" method, but it seems I can use the AEs as 
> "standalone" modules.
> However, I think this way I will not be able to benefit from 
> some of the frameworks features like exception handling, 
> multithreading etc..., but for the time being I think I can 
> live without that,
> 
> Christoph
> 
> Thilo Goetz schrieb:
> > Not sure this is going to help, but here goes.  I find this kind of 
> > situation quite common.  So I don't use a CPE, but just run an 
> > aggregate under my own control.
> > 
> > Create a UIMA app with something like this:
> > 
> > public class UimaApp {
> > 
> >   public static void main(String[] args) {
> >     try {
> >       // Get Resource Specifier from XML file
> >       XMLInputSource in = new XMLInputSource(args[0]);
> >       ResourceSpecifier specifier =
> > UIMAFramework.getXMLParser().parseResourceSpecifier(in);
> >       // Instantiate analysis engine
> >       AnalysisEngine ae = 
> UIMAFramework.produceAnalysisEngine(specifier);
> >       // Create CAS
> >       CAS cas = ae.newCAS();
> > 
> >       // Now process documents (in a loop, hooked up to a queue or 
> > whatever is convenient...)
> > 
> >       // Reset CAS before processing
> >       cas.reset();
> >       // Set document text and do other initialization
> >       cas.setDocumentText("Document text goes here");
> >       // Run ae on CAS
> >       ae.process(cas);
> >       // If necessary, get results out of CAS...
> >       System.out.println("Number of annotations: " + 
> > cas.getAnnotationIndex().size());
> > 
> >     } catch (Exception e) {
> >       e.printStackTrace();
> >     }
> >   }
> > 
> > }
> > 
> > So if the only thing you need the CPE for is the collection reader, 
> > this is an alternative for you.
> > 
> > --Thilo
> > 
> 
> 

Reply via email to