@Override public void requestDestroyed(final ServletRequestEvent sre) { owb.endContext(RequestScoped.class, sre); } }
public static void stopContexts(final ContextsService contextsService, final ServletContext servletContext, final HttpSession session) throws Exception { contextsService.endContext(Singleton.class, null); contextsService.endContext(ApplicationScoped.class, null); contextsService.endContext(SessionScoped.class, session); contextsService.endContext(RequestScoped.class, null); contextsService.endContext(ConversationScoped.class, null); if (CdiAppContextsService.class.isInstance(contextsService)) { CdiAppContextsService.class.cast(contextsService).removeThreadLocals(); } } }
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); }
private void stopConversationScope() { ContextsService contextsService = getContextsService(); contextsService.endContext(ConversationScoped.class, null); }
@Override public void deactivate() throws ContextNotActiveException { if (startParam != null) { context.getContextsService().endContext(RequestScoped.class, startParam); startParam = null; } } }
private void stopSessionScope() { ContextsService contextsService = getContextsService(); Object mockSession = null; if (isServletApiAvailable()) { mockSession = mockSessions.get(); mockSessions.set(null); mockSessions.remove(); } contextsService.endContext(SessionScoped.class, mockSession); }
public void destroyRequest(@Observes After event) { ContextsService service = this.lifecycle.get().getContextService(); service.endContext(ConversationScoped.class, null); service.endContext(RequestScoped.class, null); }
@Override public void stopSessionScope() throws Exception { logger.log(Level.FINE, "stopping the OWB SessionContext"); WebBeansContext webBeansContext = WebBeansContext.currentInstance(); ContextsService contextsService = webBeansContext.getContextsService(); contextsService.endContext(SessionScoped.class, session); }
@Override public void stopConversationScope() throws Exception { logger.log(Level.FINE, "stopping the OWB ConversationContext"); WebBeansContext webBeansContext = WebBeansContext.currentInstance(); ContextsService contextsService = webBeansContext.getContextsService(); contextsService.endContext(ConversationScoped.class, null); }
@Override public void stopRequestScope() throws Exception { logger.log(Level.FINE, "stopping the OWB RequestContext"); WebBeansContext webBeansContext = WebBeansContext.currentInstance(); ContextsService contextsService = webBeansContext.getContextsService(); contextsService.endContext(RequestScoped.class, null); }
@Override public void contextExited(final ThreadContext exitedContext, final ThreadContext reenteredContext) { if (exitedContext == null) { return; } final DestroyContext destroyContext = exitedContext.get(DestroyContext.class); if (destroyContext == null || destroyContext.threadContext != exitedContext) { return; } destroyContext.contextsService.endContext(RequestScoped.class, CdiAppContextsService.EJB_REQUEST_EVENT); CdiAppContextsService.class.cast(destroyContext.contextsService).removeThreadLocals(); }
@Override public void stopApplicationScope() throws Exception { logger.log(Level.FINE, "stopping the OWB ApplicationContext"); WebBeansContext webBeansContext = WebBeansContext.currentInstance(); ContextsService contextsService = webBeansContext.getContextsService(); contextsService.endContext(ApplicationScoped.class, servletContext); }
@Override public void contextExited(final ThreadContext exitedContext, final ThreadContext reenteredContext) { if (exitedContext == null) { return; } final DestroyContext destroyContext = exitedContext.get(DestroyContext.class); if (destroyContext == null || destroyContext.threadContext != exitedContext) { return; } destroyContext.contextsService.endContext(RequestScoped.class, null); CdiAppContextsService.class.cast(destroyContext.contextsService).removeThreadLocals(); }
/** * {@inheritDoc} */ public void sessionDestroyed(HttpSessionEvent event) { if (logger.wblWillLogDebug()) { logger.debug("Destroying a session with session id : [{0}]", event.getSession().getId()); } this.webBeansContext.getContextsService().endContext(SessionScoped.class, event.getSession()); ConversationManager conversationManager = webBeansContext.getConversationManager(); conversationManager.destroyConversationContextWithSessionId(event.getSession().getId()); }
private void stopSingletonScope() { ContextsService contextsService = getContextsService(); Object mockServletContext = null; if (isServletApiAvailable()) { mockServletContext = OwbHelper.getMockServletContext(); } contextsService.endContext(Singleton.class, mockServletContext); }
private void stopSingletonScope() { ContextsService contextsService = getContextsService(); Object mockServletContext = null; if (isServletApiAvailable()) { mockServletContext = OwbHelper.getMockServletContext(); } contextsService.endContext(Singleton.class, mockServletContext); }
private void stopApplicationScope() { ContextsService contextsService = getContextsService(); Object mockServletContext = null; if (isServletApiAvailable()) { mockServletContext = OwbHelper.getMockServletContext(); } contextsService.endContext(ApplicationScoped.class, mockServletContext); }
public void beforeUndeployment(@Observes BeforeUnDeploy event) { ContextsService service = lifecycle.get().getContextService(); service.endContext(ApplicationScoped.class, null); }
public void destroySession(@Observes BeforeUnDeploy event) { ContextsService service = this.lifecycle.get().getContextService(); //service.endContext(ApplicationScoped.class, null); service.endContext(SessionScoped.class, null); }
private void stopApplicationScope() { ContextsService contextsService = getContextsService(); Object mockServletContext = null; if (isServletApiAvailable()) { mockServletContext = OwbHelper.getMockServletContext(); } contextsService.endContext(ApplicationScoped.class, mockServletContext); }