<bean id="command" class="fiona.apple.AsyncCommand" scope="prototype">
</bean>
<bean id="commandManager" class="fiona.apple.CommandManagerImpl">
<lookup-method name="createCommand" bean="command" />
</bean>
<bean id="myValueCalculator" class="x.y.z.MyValueCalculator">
<replaced-method name="computeValue" replacer="replacementComputeValue">
<arg-type>String</arg-type>
</replaced-method>
</bean>
<bean id="replacementComputeValue" class="a.b.c.ReplacementComputeValue" />
说明
lookup-method:当fiona.apple.CommandManagerImpl的实例调用方法createCommand的时候,不进入createCommand方法(不实际调用该方法),直接返回command的实例
replaced-method:当x.y.z.MyValueCalculator的实例调用computeValue的方法的时候,用replacementComputeValue中的方法代替