avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Mouat <rob...@mouat.net>
Subject RE: [Summary] Avalon 5 ComponentManager interface
Date Wed, 12 Jun 2002 19:52:50 GMT
On Wed, 12 Jun 2002, Leo Sutic wrote:

> > From: Robert Mouat [mailto:robert@mouat.net] 
> > 
> > but, understanding that, is it a policy to discourage the use 
> > of the ComponentManager outside of compose(), i.e. are the 
> > following bad:
> 
> No. But anything coming out of a ComponentManager must be able to be 
> used as I said - lookup() in compose and remains with the composer
> for its lifetime => threadsafe.

If we make the following assumptions:

  type 1 interface (no transaction): client may assume the component is
  threadsafe

  type 2 or 2 interface (transaction involved): client may *not* assume
  the component is threadsafe.

now, if I'm writing a type 1 component then I may not lookup a type 2 or 3
interface in compose/initalize and keep it throughout the lifetime of my
type 1 component (since it would then fail to be threadsafe).

however if I am writing a type 3 component the assumption that I be
threadsafe is gone, and hence I can lookup a type 2 or 3 interface in
compose/initialize and keep it throughout the lifetime.

[If I'm writing a type 2 component, I'd have to wait until the begining of
the transaction to lookup the type 2 or 3 interface].

IOW if MyComponent keeps a type 2 or 3 component over several methods then
MyComponent cannot be assumed to be threadsafe.  And the assumption that
all lookups be threadsafe doesn't seem to give us anything.

Robert.


--
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