bdusauso
Apr 24th, 2006, 09:35 AM
Hi,
I have two ContextLoaderListener, the first is from Spring's API, the other is home made.
I'd like to launch some Quartz jobs using Spring. They're already in the application context file.
The problem is that I have some "maintenance classes", that is classes that are launched outside of the webapp, in console. They also use the Spring application context file in order to get the beans they need.
What I want is to be able to not launch the Quartz jobs when I use these "maintenance classes", only when I'm using the webapp.
I already do it with my own beans, like this :
public void contextInitialized(ServletContextEvent ev) {
ServletContext servletContext = ev.getServletContext();
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicati onContext(servletContext);
// ...
// launch of the event manager
((EventManager)wac.getBean("EventManager")).init();
//
}
How can I tell Spring not to automatically launch the scheduler but programmatically do it ?
I have two ContextLoaderListener, the first is from Spring's API, the other is home made.
I'd like to launch some Quartz jobs using Spring. They're already in the application context file.
The problem is that I have some "maintenance classes", that is classes that are launched outside of the webapp, in console. They also use the Spring application context file in order to get the beans they need.
What I want is to be able to not launch the Quartz jobs when I use these "maintenance classes", only when I'm using the webapp.
I already do it with my own beans, like this :
public void contextInitialized(ServletContextEvent ev) {
ServletContext servletContext = ev.getServletContext();
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicati onContext(servletContext);
// ...
// launch of the event manager
((EventManager)wac.getBean("EventManager")).init();
//
}
How can I tell Spring not to automatically launch the scheduler but programmatically do it ?