Following piece of code creates a bean with static method makeInstance of sampleBean2 class.

<bean id="sampleBean" class="sample.SampleBean2" factory-method="makeInstance"/>