@Test public void containerEventsShouldntGoUp() { final WebappWebBeansContext ctx = new WebappWebBeansContext(Collections.<Class<?>, Object>emptyMap(), new Properties(), new WebBeansContext()); final WebappBeanManager wbm = new WebappBeanManager(ctx) { @Override public BeanManagerImpl getParentBm() { throw new IllegalStateException("shouldn't be called"); } }; wbm.fireEvent(new GProcessProducer(null, null), true); wbm.fireEvent(new GProcessProducerField(null, null, null), true); wbm.fireEvent(new GProcessProducerMethod(null, null, null), true); wbm.fireEvent(new GProcessInjectionTarget(null, null), true); wbm.fireEvent(new GProcessBean(null, null), true); wbm.fireEvent(new GProcessAnnotatedType(ctx, null), true); wbm.fireEvent(new GProcessSessionBean(null, null, null, null), true); wbm.fireEvent(new AfterBeanDiscoveryImpl(ctx), true); wbm.fireEvent(new AfterDeploymentValidationImpl(wbm), true); wbm.fireEvent(new BeforeBeanDiscoveryImpl(ctx), true); wbm.fireEvent(new BeforeShutdownImpl(), true); }
@Override public void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent) { super.fireEvent(event, metadata, isLifecycleEvent); if (isEvent(event)) { final BeanManagerImpl parentBm = getParentBm(); if (parentBm != null) { parentBm.fireEvent(event, metadata, isLifecycleEvent); } } }
WebappBeanManager extends BeanManagerImpl { @Override public void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent) { super.fireEvent(event, metadata, isLifecycleEvent); if (isEvent(event)) { final BeanManagerImpl parentBm = getParentBm(); if (parentBm != null) { parentBm.fireEvent(event, metadata, isLifecycleEvent); } } } }
WebappBeanManager extends BeanManagerImpl { @Override public void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent) { super.fireEvent(event, metadata, isLifecycleEvent); if (isEvent(event)) { final BeanManagerImpl parentBm = getParentBm(); if (parentBm != null) { parentBm.fireEvent(event, metadata, isLifecycleEvent); } } } WebappBeanManager(final WebappWebBeansContext ctx); }
WebappBeanManager extends BeanManagerImpl { @Override public void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent) { super.fireEvent(event, metadata, isLifecycleEvent); if (isEvent(event)) { final BeanManagerImpl parentBm = getParentBm(); if (parentBm != null) { parentBm.fireEvent(event, metadata, isLifecycleEvent); } } } WebappBeanManager(final WebappWebBeansContext ctx); @Override void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent); @Override List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings); @Override Set<ObserverMethod<? super T>> resolveObserverMethods(final T event, final EventMetadataImpl metadata); @Override Object getInjectableReference(final InjectionPoint injectionPoint, final CreationalContext<?> ctx); @Override CreationalContextImpl<T> createCreationalContext(Contextual<T> contextual); @Override boolean isNormalScope(final Class<? extends Annotation> annotationType); @Override boolean isPassivatingScope(Class<? extends Annotation> annotationType); @Override boolean isQualifier(final Class<? extends Annotation> annotationType); @Override boolean isInterceptorBinding(final Class<? extends Annotation> annotationType); @Override boolean isStereotype(final Class<? extends Annotation> annotationType); @Override Set<Annotation> getInterceptorBindingDefinition(final Class<? extends Annotation> qualifier); @Override Context getContext(final Class<? extends Annotation> scope); @Override ELResolver getELResolver(); @Override AnnotatedType<T> createAnnotatedType(final Class<T> type); @Override InjectionTarget<T> createInjectionTarget(final AnnotatedType<T> type); @Override ExpressionFactory wrapExpressionFactory(final ExpressionFactory expressionFactory); BeanManagerImpl getParentBm(); @Override boolean isInUse(); @Override Set<Bean<?>> getComponents(); @Override Set<Bean<?>> getBeans(); @Override void addAdditionalAnnotatedType(Object extension, AnnotatedType<T> inAnnotatedType, String id); @Override Bean<?> getPassivationCapableBean(final String id); void afterStart(); void beforeStop(); }
WebappBeanManager extends BeanManagerImpl { @Override public void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent) { super.fireEvent(event, metadata, isLifecycleEvent); if (isEvent(event)) { final BeanManagerImpl parentBm = getParentBm(); if (parentBm != null) { parentBm.fireEvent(event, metadata, isLifecycleEvent); } } } WebappBeanManager(final WebappWebBeansContext ctx); @Override void fireEvent(final Object event, final EventMetadataImpl metadata, final boolean isLifecycleEvent); @Override List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings); @Override Set<ObserverMethod<? super T>> resolveObserverMethods(final T event, final EventMetadataImpl metadata); @Override Object getInjectableReference(final InjectionPoint injectionPoint, final CreationalContext<?> ctx); @Override CreationalContextImpl<T> createCreationalContext(Contextual<T> contextual); @Override boolean isNormalScope(final Class<? extends Annotation> annotationType); @Override boolean isPassivatingScope(Class<? extends Annotation> annotationType); @Override boolean isQualifier(final Class<? extends Annotation> annotationType); @Override boolean isInterceptorBinding(final Class<? extends Annotation> annotationType); @Override boolean isStereotype(final Class<? extends Annotation> annotationType); @Override Set<Annotation> getInterceptorBindingDefinition(final Class<? extends Annotation> qualifier); @Override Context getContext(final Class<? extends Annotation> scope); @Override ELResolver getELResolver(); @Override AnnotatedType<T> createAnnotatedType(final Class<T> type); @Override InjectionTarget<T> createInjectionTarget(final AnnotatedType<T> type); @Override ExpressionFactory wrapExpressionFactory(final ExpressionFactory expressionFactory); BeanManagerImpl getParentBm(); @Override boolean isInUse(); @Override Set<Bean<?>> getComponents(); @Override Set<Bean<?>> getBeans(); @Override void addAdditionalAnnotatedType(Object extension, AnnotatedType<T> inAnnotatedType, String id); @Override Bean<?> getPassivationCapableBean(final String id); void afterStart(); void beforeStop();  }