You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leif Mortenson <le...@silveregg.co.jp> on 2002/02/18 10:08:02 UTC

ComponentManager Lookup question? Bug?

I found this writing a test, but it seems wrong to me.

I have the following roles configuration:
<roles>
<role name="com.myco.MyClass_refA"
shorthand="myClassA"
default-class="com.myco.MyClass"/>

<role name="com.myco.MyClass_refB"
shorthand="myClassB"
default-class="com.myco.MyClass"/>
</roles>

An the following components configuration:
<components>
<myClassA attr="val1"/>

<myClassB attr="val2"/>
</components>

My code then attempts the following calls:

myClassA = (MyClass)manager.lookup("com.myco.MyClass_refA");
myClassB = (MyClass)manager.lookup("com.myco.MyClass_refB");

The problem is that both of these lookups are returning references to
the myClassB configured component. Is this by design?

I know that I can do this kind of thing using selectors.

Thanks,
Leif




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ComponentManager Lookup question? Bug?

Posted by Leif Mortenson <le...@silveregg.co.jp>.
Never mind <:-} It appears to be working fine....

Leif Mortenson wrote:

>I found this writing a test, but it seems wrong to me.
>
>I have the following roles configuration:
><roles>
><role name="com.myco.MyClass_refA"
>shorthand="myClassA"
>default-class="com.myco.MyClass"/>
>
><role name="com.myco.MyClass_refB"
>shorthand="myClassB"
>default-class="com.myco.MyClass"/>
></roles>
>
>An the following components configuration:
><components>
><myClassA attr="val1"/>
>
><myClassB attr="val2"/>
></components>
>
>My code then attempts the following calls:
>
>myClassA = (MyClass)manager.lookup("com.myco.MyClass_refA");
>myClassB = (MyClass)manager.lookup("com.myco.MyClass_refB");
>
>The problem is that both of these lookups are returning references to
>the myClassB configured component. Is this by design?
>
>I know that I can do this kind of thing using selectors.
>
>Thanks,
>Leif
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>