Eclipse custom DI [message #953829] |
Mon, 22 October 2012 11:10  |
Eclipse User |
|
|
|
Hi all!
I would like to start injecting my custom classes using the e4 dependency injection mechanism but I haven't had any luck so far.
I have a custom class called Coordinator containing an injected logger (from java.util.logging.Logger):
public class Coordinator
{
@Inject private Logger logger;
...
}
As far I have understood I have to use the InjectorFactory to achieve the DI, such as:
InjectorFactory.getDefault().addBinding(Logger.class).implementedBy(what?);
Coordinator coordinator = InjectorFactory.getDefault().make(Coordinator.class, null);
But what are the addBinding() arguments? Or am I missing something?
Regards, Daniele
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.54381 seconds