Re: [3.0] Having the Provider provide a class with an Inject

2015-01-29 Thread Stephan Classen
Even tough you have a working solution now. It is not pretty and from my perspective hard to understand what is actually happening. So I am still wondering if you need to change the returned type during runtime or if the returned type gets fixed during startup of the application. Because if it i

Re: [3.0] Having the Provider provide a class with an Inject

2015-01-29 Thread Igmar Palsenberg
> > @Override >> public TemplateResolver get() { >> String templateResolverClass = ...; /* some logic */ >> // FIXME : Wrong. Use the DI >> Class templateResolver = >> AppClassloader.classloader().loadClass(templateResolverClass).asSubclass(TemplateResolver.cl

Re: [3.0] Having the Provider provide a class with an Inject

2015-01-29 Thread Igmar Palsenberg
Hi, @Override > public TemplateResolver get() { > String templateResolverClass = ...; /* some logic */ > // FIXME : Wrong. Use the DI > Class templateResolver = > AppClassloader.classloader().loadClass(templateResolverClass).asSubclass(TemplateResolver.class);

Re: [3.0] Having the Provider provide a class with an Inject

2015-01-29 Thread Olivier Grégoire
Hello, You should use the following Provider: public class TemplateResolverProvider implements Provider { @Inject Injector injector; @Override public TemplateResolver get() { String templateResolverClass = ...; /* some logic */ // FIXME : Wrong. Use the DI

Re: [3.0] Having the Provider provide a class with an Inject

2015-01-29 Thread Stephan Classen
Hi Will this configurable provider return the same concrete type of object during the whole live time of a running program? Or will the returned type change during runtime? Because if all you want to achieve is to be able to have mocks during unit test and real implementations during runtime