avalon-phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Runnable - Avalon Framework Lifecycle interface?
Date Tue, 02 Apr 2002 12:22:44 GMT
On Tue, 2 Apr 2002 19:44, Paul Hammant wrote:
> Folks,
>
> Is java.lang.Runnable a lifecycle interface?  Does it imply that the
> implementing component should be placed in a Thread? :
>
>   if (comp instanceof Initializable) {
>     ((Initializable comp).initialize() {
>   }
>
>   if (comp instanceof Startable) {
>     ((Startable comp).start() {
>   }
>
>   if (comp instanceof Runnable) {
>     Thread t = getThread((Runnable) comp);
>     t.start();
>   }
>
> I ask because EOB has daemon beans that treat Runnable as a lifecycle
> interface.

It used to be but we zapped it because there was too many ambiguous cases. ie 
if run() finishes does that mean should we shutdown component or just call 
run again? if run() exceptions should we kill component or restart it or what 
? If we call stop and run() does not return what do we do?

-- 
Cheers,

Pete

---------------------------------------------------
"Marriage, Friends, Religon -- these are the demons 
you must slay in order to suceed in business.." 
                 -- Mr. Burns, The Simpsons 
---------------------------------------------------

--
To unsubscribe, e-mail:   <mailto:avalon-phoenix-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-phoenix-dev-help@jakarta.apache.org>


Mime
View raw message