import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
class Main {
public static void main(String args[]) throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml");
TestBean testBeanObtainedViaStaticFactory = (TestBean) ctx
.getBean("testBeanObtainedViaStaticFactory");
}
}
class StaticFactory {
public static TestBean getTestBeanInstance() {
return new TestBean();
}
}
class TestBean {
}
|