Apr 14th, 2010, 04:10 PM
@Interceptors Startup Time
I have a stateless session bean that utilizes the @Interceptors(SpringBeanAutowiringInterceptor.clas s) annotation. It seems as if the creation of the Spring context does not occur until the 1st usage of a given bean which leads to a startup cost to the first client. Is there any way to pre-init the Spring context?
Jun 4th, 2010, 10:59 AM
In your beanRefContext.xml, does setting does setting lazy-init=false on the wrapped context do anything? If not, I bet you could extend the interceptor to fix this.
Jun 4th, 2010, 11:32 AM
What I found is that, the EJB's do not execute the Intereceptors until the first invocation. So in order to get around this limitation, I create an initial bean pool explicitly and added a PostConstruct method that ensure this initialization occurs.