<bean class="com.linuxidc.spring.processor.MyBeanPostProcessor"/> <bean class="com.linuxidc.spring.bean.Life" id="life" init-method="initMethod" destroy-method="destroyMethod"> <property name="lifeName" value="myLife"/> </bean>
Test
@Test public void test03() { Life life = ctx.getBean(Life.class); life.targetMethod(); }
控制台输出:
constructor....
setLifeName....
life's postProcessBeforeInitialization....
initMethod....
life's postProcessAfterInitialization....
targetMethod....
基于 Spring 设计并实现 RESTful Web Services
Spring-3.2.4 + Quartz-2.2.0集成实例