You are viewing a plain text version of this content. The canonical link for it is here.
Posted to droids-dev@incubator.apache.org by Javier Puerto <jp...@gmail.com> on 2009/12/02 17:51:18 UTC

Re: HandlerFactory fails with multithreaded implementation

I'm working on a solution for this problem and I think that the best fix
would be to move the HandlerFactory object from CrawlingDroid to
CrawlingWorker. With the cloneable solution, every handler must override the
clone() method and implements the interface Cloneable.
I think that moving the factory to the worker could be the best solution,
because with each thread (worker) you will have a new factory object with
new handlers and you we can to forget about the clone implementation. Also,
the clone solution will create and destroy all handlers for each target
handle in each thread. Opposite, the move fix will take more memory but all
the threads will have it's own handlers.

I have a problem about this fix, I wonder where can be the HandlerFactory
init for the Worker.

What do you think about?

Salu2.