Look-Up Method Injection and itís usage in Spring Framework
This is the feature of the container to override abstract or concrete methods on managed beans in the container, to return the result of look up another named bean in the container. Usually lookup is done for a prototyped Bean.
Code of client class containing the method to be injected the method definition must be an abstract (or concrete).
In case programmer does not make method abstract Spring will override existing implementation.
protected abstract SimpleHelper createSimpleHelper();
Write Following Code in Bean Configuration File
It is important that SimpleHelper Should be prototyped otherwise always same instance will be returned.
<bean id="simpleHelper" class="..." singleton="false"/>
<bean id="CallerBean" class="...">
<lookup-method name="createSimpleHelper" bean="SimpleHelper"/>