That still has the problem of perverting IOC, though. You don't want to lock your components in to a specific container.
----- Original Message ----- From: "Stephen McConnell" <[EMAIL PROTECTED]> To: "Avalon Developers List" <[EMAIL PROTECTED]> Sent: Wednesday, October 08, 2003 1:00 PM Subject: Re: Startable doesn't has a isRunning() interface ? > > > Jonathan Hawkes wrote: > > >Perhaps then the container should provide a sort of thread management > >component through the ServiceManager. > > > > What I was thinking (before Leo's email) was that the container should > establish the principal thread and that the thread has specific > operations that allow the component to comunicate state back to the > container. I.e. keep it simple - but keep the container in a command > and control position. > > Stephen. > > > > >----- Original Message ----- > >From: "Stephen McConnell" <[EMAIL PROTECTED]> > >To: "Avalon Developers List" <[EMAIL PROTECTED]> > >Sent: Wednesday, October 08, 2003 12:50 PM > >Subject: Re: Startable doesn't has a isRunning() interface ? > > > > > > > > > >>Jonathan Hawkes wrote: > >> > >> > >> > >>>I would say it's the responsibility of the component to act as a > >>> > >>> > >container > > > > > >>>for any threads it starts up. > >>> > >>> > >>> > >>I'm ok with the notion of a container creating threads do its own stuff > >>- but this is not exactly the same thing as a component starting up a > >>thread to do its prime objective. The thing is that seems to me to be a > >>conflict between the responsibilities of a container to assure service > >>availablity, and the reopsibility of the component to implement the > >>service. Under the current Startable model, the container has no way of > >>assuring service availablity. I.e. under the current interfaces its the > >>component to container communication between startup and shutdown that > >>remains undefined. > >> > >>Stephen. > >> > >> > >> > >> > >>>Just because a component implements Startable > >>>does not necessarily mean that it is going to allocate its own threads. > >>>(Granted, that will be the case 99.9% of the time.) > >>> > >>>----- Original Message ----- > >>>From: "Stephen McConnell" <[EMAIL PROTECTED]> > >>>To: "Avalon Developers List" <[EMAIL PROTECTED]> > >>>Sent: Wednesday, October 08, 2003 10:53 AM > >>>Subject: Re: Startable doesn't has a isRunning() interface ? > >>> > >>> > >>> > >>> > >>> > >>> > >>>>Jonathan Hawkes wrote: > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>>Yes. An isRunning() method would not be useful to the container. The > >>>>>container knows whether the startable isRunning or not (ie: it has > >>>>> > >>>>> > >called > > > > > >>>>>start() and not stop() ). > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>Yeeees .. but! > >>>> > >>>>Consdider the component in question has been started. The component gets > >>>>everything it needs from the container and goes about its business and > >>>> > >>>> > >in > > > > > >>>>the case of a startable component this typically means that the > >>>> > >>>> > >component > > > > > >>>>is creating its own thread of execution. Assuming that something goes > >>>>wrong - there is not contractual interface through which the component > >>>>can notify the container that it's execution thread has terminated. > >>>> > >>>>I think the real underlying issue here is component/container > >>>>responsibility. Who should be creating and supervising/monitoring the > >>>>thread - the component or the container? > >>>> > >>>>Stephen. > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>>----- Original Message ----- > >>>>>From: "Yannick Menager" <[EMAIL PROTECTED]> > >>>>>To: <[EMAIL PROTECTED]> > >>>>>Sent: Wednesday, October 08, 2003 10:17 AM > >>>>>Subject: Startable doesn't has a isRunning() interface ? > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>>Is there any reason Startable doesn't has a isRunning() ( or something > >>>>>>like that ) interface ? > >>>>>> > >>>>>> > >>>>>> > >>>>>>--------------------------------------------------------------------- > >>>>>>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] > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>-- > >>>> > >>>>Stephen J. McConnell > >>>>mailto:[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] > >>> > >>> > >>> > >>> > >>> > >>> > >>-- > >> > >>Stephen J. McConnell > >>mailto:[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] > > > > > > > > > > -- > > Stephen J. McConnell > mailto:[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]
