avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Aaron Farr <jaaronf...@yahoo.com>
Subject [Fortress] Single Role, Multiple Components
Date Tue, 04 Mar 2003 19:23:34 GMT
Hello again.

Having trouble with FortressServiceManager/Selector again.

Okay, in my roles file I have this:

<role name="com.company.component.RoleInterface">
 <component shorthand="componentOne"
 <component shorthand="componentTwo"


First off, is this valid?  It sure appears to be.  So now we turn to the
container's configuration file:

  <componentOne id="one">

  <componentTwo id="two">

Now, if I use the service manager to lookup the role
"com.company.component.RoleInterface" or RoleInterface.ROLE, I should get a
ServiceSelector, correct?  In other words:

  Object o = m_serviceManager.lookup(RoleInterface.ROLE);

the object 'o' should be a ServiceSelector since I have two different
components of the same role.  Instead, I'm getting 'o' as a proxy for the
"ImplOne" object.  So in order for me to get an "ImplTwo" object, I have to do
something like this:

   Object o = m_serviceManager.lookup(RoleInterface.ROLE+"/componentTwo");

Is this the way it's supposed to work?  I'm fairly certain that the first
example should return a ServiceSelector since I have two components defined for
the same Role.  Perhaps I misunderstand the "contracts" of the ServiceManager,
so if anyone has some insight, I'd appriciate it.


Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more

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

View raw message