I have a spring based webapp and I also have a background process. From inside the background process, I would like to be able to access spring beans. I normally retrieve spring beans by using:
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
Object mySpringBean = context.getBean("mySpringBean");
The problem is that my background process is not servlet based and does not have access to the servletContext. The background process is triggered by a proprietary task execution program. This task execution program uses Class.forName to instantiate my background process and I am not permitted to modify the task execution program.
Is it possible for my background process to access spring beans? If so, how?
How about this?`
All you have to do is specify where your XML is