Hello Richard, Yes your explanation looks what I would have expected, but unfortunately, as Howard pointed out in a previous answer, it is not so easy to implement in Hivemind.
For your info, both my event producers and listeners are my own services (not Hivemind services), but for some I absolutely need a threaded model (I would like to avoid using ThreadLocalStorage by using a threaded service instead) while for others there is no point in having more than one instance for the whole system. Thank you anyway Cheers -----Original Message----- From: Hensley, Richard [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 11:31 PM To: '[email protected]' Subject: RE: event producing services and threaded or pooled model Jean, Are your listener's services or objects from the outside of hivemind. If you listeners are hivemind services, the listeners will obey the semantics supplied by the service implementation model of the listener service. Also, Hivemind will inject them to your service. If they are objects injected from outside of Hivemind, the listener injector will need knowledge of the model of the service. If the model is singleton, the listener injector should inject the listeners once. If the model is threaded, the listener injector should inject the listeners each time you get the service because Hivemind creates a new instance each time the service is requested. If the model is pooled, the listener injector should inject the listeners the first time the service is requested because the pooled logic get's an instance out of a pool, or creates them as needed. Basically, I hope the length of the paragraph encourages you to use hivemind services as listeners. Richard -----Original Message----- From: Jean-Francois Poilpret [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 8:11 AM To: [email protected] Subject: event producing services and threaded or pooled model 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
