It's a little hard to tell from your description, but it SOUNDS like you're not quite using Spring correctly here.
See, Spring works best when it works using an injection philosophy, not when you're explicitly looking up the beans in the Context/BeanFactory. If your object is managed by Spring, you can just as easily inject it's dependencies using autowiring:
Code:
@Service
public class MyClassImpl implements MyClass {
private RuleMonthlyRangeBinder binder;
@Autowired
public MyClassImpl(RuleMonthlyRangeBinder binder) {
this.binder = binder;
}
}
If you need to get ALL implementations of an interface, just autowire a collection of the interface. That'll automatically pull everything in.
As a rule of thumb, I consider use of getBean() in "normal" code to be a red flag - if you're using it, there's a pretty good chance you're using the framework incorrectly.
Hope this helps
- Don