protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Collections.unmodifiableSet(new HashSet<Annotation>(Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).values())); if (Beans.findInterceptorBindingConflicts(beanManager, interceptorBindingTypes)) { throw new DeploymentException(BeanLogger.LOG.conflictingInterceptorBindings(getType())); } }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
@SuppressWarnings("unchecked") private InterceptorClassMetadata<T> initInterceptorMetadata() { CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this); return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false, getBeanManager())); }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues(); }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues(); }
protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) { if (interceptor instanceof InterceptorImpl<?>) { EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated(); if (!BeanMethods.getObserverMethods(annotated).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor); } if (!interceptor.getScope().equals(Dependent.class)) { throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor); } while (annotated != null && annotated.getJavaClass() != Object.class) { if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor); } if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor); } if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) { throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor); } annotated = annotated.getEnhancedSuperclass(); } } for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { validateInjectionPoint(injectionPoint, manager); } }
protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues(); }
protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues(); }
protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) { super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager); this.interceptorMetadata = initInterceptorMetadata(); this.serializable = type.isSerializable(); this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues(); }