public void observesApplicationScopedBeforeDestroyed(@Observes @BeforeDestroyed(ApplicationScoped.class) Object obj){ isBeforeDestroyed = true; beforeDestroyedEventPayload = obj; }
void observeBeforeDestroyed(@Observes @BeforeDestroyed(ConversationScoped.class) ServletRequest event) { if (event.getAttribute("foo") != null) { beforeDestroyedCalled.set(true); } }
public void observesRequestContextBeforeDestroyed(@Observes @BeforeDestroyed(RequestScoped.class) Object object) { beforeDestroyedCounter.incrementAndGet(); }
public void observeBeforeDestroyed(@Observes @BeforeDestroyed(RequestScoped.class) ServletRequest event){ beforeDestroyedRequestCount.incrementAndGet(); }
public void observeSessionBeforeDestroyed(@Observes @BeforeDestroyed(SessionScoped.class) HttpSession event) { beforedDestroyedSessionCount.incrementAndGet(); }
public void destroy(@Observes @BeforeDestroyed(ApplicationScoped.class) ServletContext init) { log.info("Closing LDAP connection at server shutdown..."); PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get(); closePersistenceEntryManager(persistenceEntryManager, ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME); List<PersistenceEntryManager> persistenceAuthEntryManagers = persistenceAuthEntryManagerInstance.get(); closePersistenceEntryManagers(persistenceAuthEntryManagers); }
private final void onShutdown(@Observes @BeforeDestroyed(ApplicationScoped.class) @Priority(Interceptor.Priority.PLATFORM_BEFORE - 1) final Object event) throws Throwable { final CountDownLatch latch = this.webServersLatch; if (latch != null && latch.getCount() > 0L) { this.webServersLatch.await(); } Throwable throwMe = null; synchronized (this.errors) { if (!this.errors.isEmpty()) { final Iterator<? extends Throwable> iterator = this.errors.iterator(); assert iterator != null; while (iterator.hasNext()) { final Throwable t = iterator.next(); assert t != null; iterator.remove(); if (throwMe == null) { throwMe = t; } else { throwMe.addSuppressed(t); } } } } if (throwMe != null) { throw throwMe; } }
@BeforeDestroyed(ApplicationScoped.class) @Priority(Interceptor.Priority.PLATFORM_BEFORE - 1) final Object event)
@BeforeDestroyed(ApplicationScoped.class) @Priority(LIBRARY_BEFORE) final Object event)