public void contextEntered(ThreadContext oldContext, ThreadContext newContext) {
final BeanContext beanContext = newContext.getBeanContext();
final WebBeansContext webBeansContext = beanContext.getModuleContext().getAppContext().getWebBeansContext();
final ContextsService contextsService = webBeansContext.getContextsService();
final Context requestContext = contextsService.getCurrentContext(RequestScoped.class);
if (requestContext == null) {
contextsService.startContext(RequestScoped.class, null);
newContext.set(DestroyContext.class, new DestroyContext(contextsService, newContext));
}
}