On Tuesday 30 December 2003 15:02, Timothy Bennett wrote: > Of course, the ManagerComponent goes off and does other things,
of course... > "forgetting" about the WorkerComponent instances running in thread. > When the thread ends, how does merlin know to invoke the stop or dispose > lifecycle method? It depends if you declare the "conservative" or "liberal" (think it is called "weak") lifecycle handling. If conservative, the component requestor _should_ call ServiceManager.release(), but since it is no longer aware of what is going on, I guess that the component itself could do a SM.release() (not sure though). If declaring "weak", Merlin will only hold a Soft/Weak Reference (java.lang.ref package) to detect when the component is no longer hard-referenced, including the Thread running it. So, when the Thread is finished, it will release the Runnable reference and Merlin will detect that the component should "die", and invokes the lifecycle methods. (There has been a long thread about this a few weeks back.) > Is this even a *correct* way to use a transient component? Should be OK, but you can not be sure _when_ the lifecycle methods (stop, dispose) is called, it could be deferred to any point in time in the future, as a GC cycle must commence first. Niclas --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
