This is something I've thought about as well, and don't have an easy solution for.
I think, perhaps, a proxy should be set up and that should be the listener. The proxy will delegate to the actual, per-thread, service. The problem is ... there's a tangle between ServiceModel and ServiceImplementationFactory (specifically, the BuilderFactory implementation) on who'se responsible for this. I believe I'll have to add methods to ServiceModel to control this, and have BuilderFactory merely identify which services/listeners should be connected. ServiceModel can decide how to procede. So it's doable, but will take a bit of work. With the current code, I'd simply say ... don't do it! On Mon, 18 Oct 2004 22:11:03 +0700, Jean-Francois Poilpret <[EMAIL PROTECTED]> wrote: > Hi all, > > I have currently a recurring question in mind about the following problem: > > I have created a service A interface that accepts event listeners (with the > usual addFooListener()/removeFooListener() methods). > In the implementation class I have defined a EventListenerList member (not > static) to hold the list of listeners to the events produced by the service. > > Now what will happen if I use the threaded or pooled service model for my > service? > For instance, if I create a second service B which implementation consumes > the events provided by service A, construct B with BuilderFactory with the > singleton model, how will it be linked to service A (or more exactly all the > instances of A since it is threaded/pooled)? > > Can we say that HiveMind will call A.addFooListener(B) for _every_ threaded > instance of A? > I did not check it yet, but since I am currently working in quite a big task > and I started wondering about this point (which answer will probably have an > impact on what I am doing), I would need some clarification about this > point. > I tried to find the answer to my question in the doc to no avail. > > Thank you in advance for any answer > > Cheers > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
