public void observesApplicationScopedIsDestroyed(@Observes @Destroyed(ApplicationScoped.class) Object obj) { isDestroyed = true; destroyedEventPayload = obj; }
public void observesAppShutdown(@Observes @Destroyed(ApplicationScoped.class) Object event) { if (event != null) { toBeDestroyed.set(true); } } }
public void observeConversationDestroyed(@Observes @Destroyed(ConversationScoped.class) ServletRequest event) { destroyed = true; }
void shutdown(@Observes @Destroyed(ApplicationScoped.class) Object event) { System.out.println("Camel CDI :: Example 1 will be stopped"); // The context is stopped in the @PreDestroy lifecycle callback (see class SimpleCamelContext) }
public void secondDestroy(@Observes @Destroyed(RequestScoped.class) ServletRequest servletRequest) { destroyedEvents.add("B"); }
void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { destroyedCalled.set(true); }
void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { destroyedCalled.set(true); }
void observeRequestDestroyed(@Observes @Destroyed(ConversationScoped.class) ServletRequest event) { if (event.getAttribute("foo") != null) { destroyedCalled.set(true); } }
public void observeSessionDestroyed(@Observes @Destroyed(SessionScoped.class) HttpSession event) { destroyedSessionCount.incrementAndGet(); }
void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { destroyedCalled.set(true); }
public void observeConversationDestroyed(@Observes @Destroyed(ConversationScoped.class) String event) { if (destroyedConversationId.get() != null) { throw new IllegalStateException("Only one non-attached long-runnnig conversation should be destroyed"); } destroyedConversationId.set(event); }
public void observesRequestContextDestroyed(@Observes @Destroyed(RequestScoped.class) Object object) { destroyedCounter.incrementAndGet(); }
public void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { destroyedRequestCount.incrementAndGet(); }
public void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) ServletRequest event) { destroyedRequestCount.incrementAndGet(); }
void observeRequestDestroyed(@Observes @Destroyed(RequestScoped.class) Object event) { destroyedCalled.set(true); }
public void firstDestroy(@Observes @Destroyed(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION) ServletRequest servletRequest) { destroyedEvents.add("A"); }
public void thirdDestroy(@Observes @Destroyed(RequestScoped.class) @Priority(Interceptor.Priority.APPLICATION + 501) ServletRequest servletRequest) { destroyedEvents.add("C"); }
public void stop(@Observes @Destroyed(ApplicationScoped.class) Object ignore) { synchronized (lock) { if (cassandraDaemon != null) { cassandraDaemon.deactivate(); } } } }
public class FlowCDIEventFireHelperImpl implements Serializable, FlowCDIEventFireHelper { private static final long serialVersionUID = -5689195252450178355L; @Inject @Initialized(FlowScoped.class) Event<Flow> flowInitializedEvent; @Inject @Destroyed(FlowScoped.class) Event<Flow> flowDestroyedEvent; @Override public void fireInitializedEvent(Flow currentFlow) { flowInitializedEvent.fire(currentFlow); } @Override public void fireDestroyedEvent(Flow currentFlow) { flowDestroyedEvent.fire(currentFlow); } }
public class ViewScopedCDIEventFireHelperImpl implements Serializable, ViewScopedCDIEventFireHelper { private static final long serialVersionUID = 5777997951420156171L; @Inject @Initialized(ViewScoped.class) Event<UIViewRoot> viewScopeInitializedEvent; @Inject @Destroyed(ViewScoped.class) Event<UIViewRoot> viewScopeDestroyedEvent; @Override public void fireInitializedEvent(UIViewRoot root) { viewScopeInitializedEvent.fire(root); } @Override public void fireDestroyedEvent(UIViewRoot root) { viewScopeDestroyedEvent.fire(root); } }