I want to make applicationContext inside scheduler method. it is possible ? )
<task:annotation-driven executor="executor" scheduler="scheduler"/>
<task:executor id="executor" pool-size="5"/>
<task:scheduler id="scheduler" pool-size="10"/>
And my class :
@Scheduled(fixedDelay=100)
public void doSomething() {
}
How me add that ? :
private ApplicationContext applicationContext;
@Override
public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
this.applicationContext = applicationContext;
}
That use it code :
JDBCEntityDAO obj = (JDBCEntityDAO) applicationContext.getBean("taEntityDAO");
Help please