/** * Set a callback used during observer notification. The callback parameter is an event object. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(Consumer<T> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, null, callback, requiredAnnotations); }
/** * Set a callback used during observer notification. The first callback parameter is an event object and the second parameter is a {@link BeanManager} * instance. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(BiConsumer<T, BeanManager> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, callback, null, requiredAnnotations); }
/** * Set a callback used during observer notification. The callback parameter is an event object. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(Consumer<T> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, null, callback, requiredAnnotations); }
/** * Set a callback used during observer notification. The first callback parameter is an event object and the second parameter is a {@link BeanManager} * instance. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(BiConsumer<T, BeanManager> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, callback, null, requiredAnnotations); }
/** * Set a callback used during observer notification. The callback parameter is an event object. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(Consumer<T> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, null, callback, requiredAnnotations); }
/** * Set a callback used during observer notification. The first callback parameter is an event object and the second parameter is a {@link BeanManager} * instance. * <p> * This is a terminal operation. * * @param callback * @return the built observer * @see ObserverMethod#notify(Object) */ public ContainerLifecycleObserver<T> notify(BiConsumer<T, BeanManager> callback) { Preconditions.checkArgumentNotNull(callback, CALLBACK); return new ContainerLifecycleObserver<>(priority, observedType, callback, null, requiredAnnotations); }