/** * {@inheritDoc} */ @Override public void sessionDestroyed(HttpSessionEvent event) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Destroying a session with session id : [{0}]", event.getSession().getId()); } this.lifeCycle.getContextService().endContext(SessionScoped.class, event.getSession()); this.lifeCycle.getContextService().endContext(ConversationScoped.class, event.getSession()); } }
/** * {@inheritDoc} */ @Override public void sessionCreated(HttpSessionEvent event) { try { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Starting a session with session id : [{0}]", event.getSession().getId()); } this.lifeCycle.getContextService().startContext(SessionScoped.class, event.getSession()); } catch (Exception e) { logger.log(Level.SEVERE, WebBeansLoggerFacade.constructMessage(OWBLogConst.ERROR_0020, event.getSession())); WebBeansUtil.throwRuntimeExceptions(e); } }
/** * {@inheritDoc} */ @Override public void sessionCreated(HttpSessionEvent event) { try { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Starting a session with session id : [{0}]", event.getSession().getId()); } this.lifeCycle.getContextService().startContext(SessionScoped.class, event.getSession()); } catch (Exception e) { logger.log(Level.SEVERE, WebBeansLoggerFacade.constructMessage(OWBLogConst.ERROR_0020, event.getSession())); WebBeansUtil.throwRuntimeExceptions(e); } }
/** * {@inheritDoc} */ @Override public void sessionDestroyed(HttpSessionEvent event) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Destroying a session with session id : [{0}]", event.getSession().getId()); } boolean mustDestroy = ensureRequestScope(); this.lifeCycle.getContextService().endContext(SessionScoped.class, event.getSession()); if (mustDestroy) { requestDestroyed(null); } }
private boolean ensureRequestScope() { Context context = this.lifeCycle.getContextService().getCurrentContext(RequestScoped.class); if (context == null || !context.isActive()) { requestInitialized(null); return true; } return false; }
public void beforeUndeployment(@Observes BeforeUnDeploy event) { ContextsService service = lifecycle.get().getContextService(); service.endContext(ApplicationScoped.class, null); }
public void createSession(@Observes AfterDeploy event) { ContextsService service = this.lifecycle.get().getContextService(); //service.startContext(ApplicationScoped.class, null); service.startContext(SessionScoped.class, null); }
public void destroySession(@Observes BeforeUnDeploy event) { ContextsService service = this.lifecycle.get().getContextService(); //service.endContext(ApplicationScoped.class, null); service.endContext(SessionScoped.class, null); }
public void requestInitialized(ServletRequest servletRequest) { try { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Starting a new request : [{0}]", servletRequest.getRemoteAddr()); } this.lifeCycle.getContextService().startContext(RequestScoped.class, new ServletRequestEvent(this.servletContext, servletRequest)); // we don't initialise the Session here but do it lazily if it gets requested // the first time. See OWB-457 } catch (Exception e) { logger.log(Level.SEVERE, WebBeansLoggerFacade.constructMessage(OWBLogConst.ERROR_0019, servletRequest)); WebBeansUtil.throwRuntimeExceptions(e); } }
public void requestDestroyed(ServletRequest request) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Destroying a request : [{0}]", request.getRemoteAddr()); } // clean up the EL caches after each request ELContextStore elStore = ELContextStore.getInstance(false); if (elStore != null) { elStore.destroyELContextStore(); } this.lifeCycle.getContextService().endContext(RequestScoped.class, new ServletRequestEvent(this.servletContext, request)); this.cleanupRequestThreadLocals(); }
/** * {@inheritDoc} */ @Override public void requestInitialized(ServletRequestEvent event) { try { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Starting a new request : [{0}]", event == null ? "null" : event.getServletRequest().getRemoteAddr()); } this.lifeCycle.getContextService().startContext(RequestScoped.class, event); // we don't initialise the Session here but do it lazily if it gets requested // the first time. See OWB-457 } catch (Exception e) { logger.log(Level.SEVERE, WebBeansLoggerFacade.constructMessage(OWBLogConst.ERROR_0019, event == null ? "null" : event.getServletRequest())); WebBeansUtil.throwRuntimeExceptions(e); } }
public void createRequest(@Observes Before event) { ContextsService service = this.lifecycle.get().getContextService(); service.startContext(RequestScoped.class, null); service.startContext(ConversationScoped.class, null); }
public void destroyRequest(@Observes After event) { ContextsService service = this.lifecycle.get().getContextService(); service.endContext(ConversationScoped.class, null); service.endContext(RequestScoped.class, null); }
/** * {@inheritDoc} */ @Override public void requestDestroyed(ServletRequestEvent event) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Destroying a request : [{0}]", event == null ? "null" : event.getServletRequest().getRemoteAddr()); } // clean up the EL caches after each request ELContextStore elStore = ELContextStore.getInstance(false); if (elStore != null) { elStore.destroyELContextStore(); } this.lifeCycle.getContextService().endContext(RequestScoped.class, event); this.cleanupRequestThreadLocals(); }
public void afterMethod(@Observes After event) { ContainerLifecycle lc = lifecycle.get(); if (lc == null) { // this may happen if there was a DeploymentError during CDI boot return; } ContextsService service = lc.getContextService(); service.endContext(ConversationScoped.class, null); service.endContext(SessionScoped.class, null); service.endContext(RequestScoped.class, null); }
public void beforeMethod(@Observes Before event) { ContainerLifecycle lc = lifecycle.get(); if (lc == null) { // this may happen if there was a DeploymentError during CDI boot return; } ContextsService service = lc.getContextService(); service.startContext(RequestScoped.class, null); service.startContext(SessionScoped.class, null); service.startContext(ConversationScoped.class, null); }
this.lifeCycle.getContextService().endContext(RequestScoped.class, event);