I would ask whether the code below is properly synchronized?
I'm afraid that not, because the ctx variable is not volatile nor the access to it is synchronized?


Quote Originally Posted by haninaguib View Post
Ok so here is a solution (got it from another post in this forum)
In the spring context I load a SpringContext object

Code:
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringContext implements ApplicationContextAware {
	private static ApplicationContext ctx;
	
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		ctx = applicationContext;
	}
	
	public static ApplicationContext getContext() { return ctx; }
	
}
Then in my soap service implementation I can get the spring context
Code:
        ....
        Object aBean = SpringContext.getContext().getBean("aBean");
        .....
I know this is not ideal, so if someone knows the 'proper way' please let me know.

Hani