Think I've lost two replies to this before sending so far...

Simon Mieth wrote:

On Tue, 27 Jan 2004 12:29:52 -0500
"Jeffrey Winter" <[EMAIL PROTECTED]> wrote:



I have been exploring using Cocoon in a standalone,
event-driven, multi-threaded application via the
CocoonBean.

Is it possible to use the CocoonBean to handle individual
transformation requests in this manner?  From what I can
tell, a request for an individual transformation can be
made by calling addTarget(), but these requests appear to
accumulate even after disposition in the "Crawler." Is
there anyway to remove the targets once the request is
complete?

Is there a more practical way to request a transformation
besides calling addTarget() then process(), perhaps using
lower-level mechanisms?

Is the CocoonBean re-entrant, or must there be a new
instance of a CocoonBean bound to each thread?


Thanks



Hi Jeffrey,


i had the same problem. my solution (discussed on the
dev-list some weeks before):

add to CocoonBean


public void removeAllTarget(){
this.crawler = new Crawler();
}


I've added one of these to my own checkout. Will check it in along with some internationalisation code I'm working on.

then you can add the same targest as before and build the
pipelines with the followlink,... -features from the
CocoonBean.

But if you only need a single result from the pipeline,
maybe CocoonBean.processURI(uri,OutputStream) (from
CocoonWrapper). I have not tried this before, but found in
the java-docs.


It is currently untested. Try it and report back please.

As to is it 're-entrant'? Well, adding the Crawler class took it a lot further to being rentrant, but it isn't there yet. At the moment, the Bean is configured using cocoonBean.addTarget(). For it to be re-entrant, each call would need to use a different Crawler, with crawler.addTarget() used to add new targets. We'd have to decide what interface we want to expose, but when we've done that, I think the code changes should be pretty easy.

Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to