avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [RT] Management vs. Component Resolution
Date Fri, 30 Aug 2002 13:57:27 GMT

> From: Berin Loritsch [mailto:bloritsch@apache.org] 
> > From: Leo Sutic [mailto:leo.sutic@inspireinfrastructure.com]
> > 
> > How about this then:
> > 
> > Define all publishing to be global and via JNDI.
> > 
> > A container is told to publish services X, Y and Z, and to
> > bind them to certain points in the JNDI context:
> > 
> >   <publish service="<service id>" as="java:/SomeName"/>
> >   <publish service="<other service id>" as="java:/SomeOtherName"/>
> > 
> > and in the super-container:
> > 
> >   <import service="<service id>" from="java:/SomeName"/>
> >   <import service="<other service id>" from="java:/SomeOtherName"/>
> > 
> > The super-container can then access these services via JNDI
> > and import them into its namespace that way.
> That is the J2EE Style publishing I talked about in the first section.

OK, misunderstood you. I though you were talking about publishing being
done by the service itself and the import being done by the component
requiring the service - i.e. the container would not be involved either
binding nor in getting the service from JNDI.

Guess we're on the same page then.
> To keep things predictable, I would put it in this namespace:
> "avalon:/services/${service-name}"
> Once it is in JNDI, which can ONLY be assigned during 
> initialization, it is accessible via JNDI so there is no need 
> to <import/>.

I would still think there is a need for <import/>, but let's
leave that for now.

> We might have to use container names in the lookup key to 
> prevent name collisions--or at the very least not allow the 
> new service to be bound if it conflicts with something.  

Since service names are opaque strings, there must be a way
to configure such names at the assembly level.

> If you want to access a globally accessible service, you get an
> InitialContext()

Nitpick: The container gets an InitialContext. The whole point is 
to be able to access globally accessible services published via JNDI 
via the ServiceManager interface. The Serviceable component should not
need to care whether the service comes in via JNDI or whether it is
a peer in the container.

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

View raw message