A crawler is not re-entrant. You need a new one each time. So you would call bean.process(crawler) with a newly created crawler.On Fri, 30 Jan 2004 22:11:27 +0000 Upayavira <[EMAIL PROTECTED]> wrote:
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
Hi Upayavira,
i hope i understood this. A 're-entrant' Target need a new
Crawler, an 'new Target' (which was not processed before)
can add to the old Crawler and processed with it? If there any benefit to distinguish these cases? In most cases someone add Targets to the Bean an call
process(). All Targets in the Crawler now process and cannot
processed again with this Crawler. If i add now one of the
processed Targest, i want process this Target again.
Obviously all of your 'set' javabean properties of the bean would need to be set and left alone before going into a multithreaded mode, so the bean isn't strictly threadsafe, at least until the bean is initialised. To make it properly threadsafe would probably require quite a redesign.
Is so, then it is possible, the Crawler is replaced afterAs I say above, you'd call process(crawler) passing it a new crawler each time.
every process()-call with a new empty Crawler?
With CheckSumURI, there is a controller over processed URI'sThe checksum stuff is pretty basic, and a bit of a hack. That wouldn't work in a multithreaded environment without some work.
too.
Other question ;)To stop processing? How would you like to stop processing? From another thread? You could have crawler.setStop(true) which the process() method would check isStop == true to find out whether it should continue or not. That wouldn't be too hard.
Is there a way to stop the processing? I have only found
dispose(), but this need then a new CocoonBean-instance.
Simon, if you're doing this sort of work with the bean, and understanding how it works, then send in patches. Make it do what you want it to do. We can then commit those patches and everyone benefits. That's how I got involved with it, I just started sending in patches.
Regards, Upayavira
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
