Hi there,
after receiving good advice on how to design my application (thanks) and removed
error I made, I stumbled over a strange thing.
Basicly in one component I need to subsequently call on 3 other components
(WidgetA, WidgetB, WidgetC) which all implement a GenericWidget Interface that
represents the service. The three widgets are declared as singeltons and all
three widgets are defined in the block.xml.
When I call on the selector with a sequence of hints "WidgetA", "WidgetB",
"WindgetC"
the selector always returns WidgetB even though it recognizes the hint
correctly. It just returns the wrong component. The Widget itself works fine for
the calling component. Unfortunatly in two out of three cases it's the wrong
one.
I also tried to do the sequence of lookups in the component itself and had the
same result. I build the selector just for testing and clarification but it
didn't change the problem.
/**
* @avalon.component version="1.0" name="Criterias" lifestyle="singleton"
* @avalon.service type="CriteriaSelector" version="1.0"
*
*/
public class CriteriaSelectorImpl
implements CriteriaSelector, Serviceable
{
private ServiceManager m_Manager;
/**
* @avalon.dependency type="GenericWidget:1.0" key="WidgetA"
* @avalon.dependency type="GenericWidget:1.0" key="WidgetB"
* @avalon.dependency type="GenericWidget:1.0" key="WidgetC"
*/
public void service(ServiceManager man)
{
m_Manager = man;
}
public GenericWidget get(String hint)
throws ServiceException
{
if (hint != null)
{
return (GenericWidget) m_Manager.lookup(hint);
}
return null;
}
}
Could anybody give me clue what I might be doing wrong or what I missed?
Thanks
Florian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]