Hi all.
I have a setup where a lot of concrete service classes happened to
have identical logic, so I wanted to abstract that logic to an
abstract class. But it looks like what happens is that iPOJO won't
inject parameters unless they are on the bottom-level concrete class.
In other words, I'm trying to do this:
public interface Service {
void doComplicatedStuff();
}
@Component
public class AbstractService implements Service {
@Requires
private OtherService otherService;
@Override
public void doComplicatedStuff() {
// ... complicated logic using otherService ...
}
}
@Component
@Provides
public class ConcreteService extends AbstractService {
}
And when I get to doComplicatedStuff(), otherService is always null.
Does the iPOJO voodoo just not support this situation? The same logic
with the same service on the concrete class works fine so I expected
it to work here too, and I didn't see any warnings at the time it
mangled the classes or at runtime, indicating any problem...
TX
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]