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
>
> @Override
>> public TemplateResolver get() {
>> String templateResolverClass = ...; /* some logic */
>> // FIXME : Wrong. Use the DI
>> Class templateResolver =
>> AppClassloader.classloader().loadClass(templateResolverClass).asSubclass(TemplateResolver.cl
Hi,
@Override
> public TemplateResolver get() {
> String templateResolverClass = ...; /* some logic */
> // FIXME : Wrong. Use the DI
> Class templateResolver =
> AppClassloader.classloader().loadClass(templateResolverClass).asSubclass(TemplateResolver.class);
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
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