Jaaron,
Sorry to keep asking for so much on this one, but I still need a little moreNo problem, the learning curve for me was the price to pay to use an awesome tool. In addition, you are writing a doc. for newbies, so that's a great plus!
help.
In my original example we were modifying the SwingContainer class. So if I nowHere's what you can do:
have two translators in the .xconf file with only the id different
("translator1" and "translator2") then I should be able to change this line:
m_translator =
(org.apache.avalon.fortress.examples.components.Translator)m_serviceManager.lookup(
org.apache.avalon.fortress.examples.components.Translator.ROLE );
To something like these two lines:
ServiceSelector selector = (ServiceSelector) m_serviceManager.lookup(
org.apache.avalon.fortress.examples.components.Translator.ROLE);
m_translator = (org.apache.avalon.fortress.examples.components.Translator)
sel.select("translator1");
That should work, shouldn't it? Instead I get:
org.apache.avalon.fortress.InitializationException: Cannot set up impl. Startup
lifecycle failure
...
Caused by: org.apache.avalon.framework.service.ServiceException: Component does
not exist
(Key='org.apache.avalon.fortress.examples.components.Translator/transl
ator1')
So apparently I'm still messing something up with the Selector. Any thoughts?
Object o = m_serviceManager.lookup(org.apache.avalon.fortress.examples.components.Translator.ROLE);
if (o instanceof ServiceSelector) {
m_translator = ((ServiceSelector)o).select("translator1");
} else {
m_translator = (Translator)o;
}
Shash
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]