FactoryInjector in picocontainer-script XML

View: New views
1 Messages — Rating Filter:   Alert me  

FactoryInjector in picocontainer-script XML

by Kai Runte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hallo,

I'm new to picocontainer and just managed my first steps using a FactoryInjector:
        final MutablePicoContainer pico = new DefaultPicoContainer();
        pico.addComponent(Echo2FilterGroupHandler.class);
        pico.addAdapter(new Echo2FilterCollectionHandlerFactory());
        final Echo2FilterGroupHandler filterGroupHandler = pico.getComponent(Echo2FilterGroupHandler.class);

Works like a charm, so far so great.
Now I would to store the above setup in an XML file and load it using picocontainer-script XML, but have failed miserably to define the Echo2FilterCollectionHandlerFactory (extends FactoryInjector<Echo2FilterCollectionHandler>). So far I got this:
<container>
    <component-adapter-factory key="factory"
            class="handler.Echo2FilterCollectionHandlerFactory">
    </component-adapter-factory>
    <component-implementation
            key="handler.Echo2FilterGroupHandler"
            class="handler.Echo2FilterGroupHandler">
    </component-implementation>
</container>
but I don't know how I connect the factory to Echo2FilterGroupHandler class. Any help is greatly appreciated!

Thanks
 Kai