0
我需要在代碼執行期間「即時」創建對象的原型範圍實例。使用參數動態創建Prototype對象的實例
我知道的查找方法是很好的解決方案:
<!-- a stateful bean deployed as a prototype (non-singleton) -->
<bean id="command" class="fiona.apple.AsyncCommand" scope="prototype">
<!-- inject dependencies here as required -->
</bean>
<!-- commandProcessor uses statefulCommandHelper -->
<bean id="commandManager" class="fiona.apple.CommandManager">
<lookup-method name="createCommand" bean="command"/>
</bean>
我可以設置參數createCommand
方法?
感謝Bozho,我想過了,但我只是想確定... –