avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Berin Loritsch" <blorit...@apache.org>
Subject RE: [Avalon5] Startable interface
Date Mon, 10 Jun 2002 03:51:31 GMT
> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org] 
> 
> From: "Berin Loritsch" <bloritsch@apache.org>
> 
> > Now, on initialization, I can understand exception throwing 
> because we 
> > have to not let the component be available to other 
> components. If the 
> > component is not stable because it couldn't allocate thread 
> resources 
> > that it needs, that is an Exception.
> >
> > However, on the stop() method, it really isn't helpful.  We are 
> > getting rid of the component at this stage--so why should 
> we care if 
> > it can't get rid of the thread it wanted.  We can force 
> everything to 
> > shut down hard if necessary.
> 
> Threads?
> What does start-stop have to do with threads?
> Startable has no notion of concurrency.

An active component is running all the time in the background.
Hense, it needs to be start()ed.  What other things require
start()ing?


> You also assume that stop() has no side-effects, which is 
> wishfull thinking.

Question:

At this stage what can you do about it?  You are getting ready
to remove the component.  If there is information to be passed
regarding the stop()ing of something then we should return it
as information--not throw an exception.

An exception is for exceptionnal occasions--Not for passing
information.  Using it to pass information is not good, and
an expensive way to do it.

Just do what you mean.


> > Now, if you start up a thread that only needs to run to completion, 
> > that is another thing entirely.  The concept behind the Startable 
> > interface is an active component that has a thread running in the 
> > background at all times, until it is stop()ed.
> 
> I just use the common meaning.
> 
> Configure: On your marks
> 
> Init: get ready.
> Start: GO!
> 
> Suspend: Freeze!
> Resume: Continue!
> Suspend: Freeze!
> Resume: Continue!
> 
> Stop: Stop!
> Dispose: Get Off!
> 
> Now, what does this have to do with threads?

Practically speaking, what types of components do you develop that
implement Startable and don't involve a background thread?  Check
out the Connection handling stuff in Cornerstone.  Check out
Monitor.  Practically speaking, that is.


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


Mime
View raw message