@SuppressWarnings("unchecked") public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) { return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(), interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null); }
@Override public boolean isEligible(InterceptionType interceptionType) { return factory.getInterceptor().intercepts(javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) { if (interceptorMetadata.getInterceptorFactory() instanceof CdiInterceptorFactory<?> && passivationCapabilityCheckRequired) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor(); beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager(); for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint)); validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean); if (interceptorMetadata.getInterceptorFactory() instanceof PlainInterceptorFactory<?>) { PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Class<?> interceptorClass = interceptorMetadata.getJavaClass();
@SuppressWarnings("unchecked") public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) { return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass()); }
@Override @SuppressWarnings("unchecked") public InterceptorInvocation getInterceptorInvocation(Object interceptorInstance, InterceptionType interceptionType) { return new CustomInterceptorInvocation<T>(factory.getInterceptor(), (T) interceptorInstance, javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
private List<Interceptor<?>> extractCdiInterceptors(Collection<? extends InterceptorClassMetadata<?>> interceptorMetadatas) { // ignore interceptors which are not CDI interceptors ArrayList<Interceptor<?>> interceptors = new ArrayList<Interceptor<?>>(); for (InterceptorClassMetadata<?> interceptorMetadata : interceptorMetadatas) { InterceptorFactory<?> interceptorFactory = interceptorMetadata.getInterceptorFactory(); if (interceptorFactory instanceof CdiInterceptorFactory<?>) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorFactory; interceptors.add(cdiInterceptorFactory.getInterceptor()); } } return interceptors; }
@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())); }
for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) { if (interceptorMetadata.getInterceptorFactory() instanceof CdiInterceptorFactory<?> && passivationCapabilityCheckRequired) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor(); beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager(); for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint)); validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean); if (interceptorMetadata.getInterceptorFactory() instanceof PlainInterceptorFactory<?>) { PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Class<?> interceptorClass = interceptorMetadata.getJavaClass();
@Override @SuppressWarnings("unchecked") public InterceptorInvocation getInterceptorInvocation(Object interceptorInstance, InterceptionType interceptionType) { return new CustomInterceptorInvocation<T>(factory.getInterceptor(), (T) interceptorInstance, javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
private List<Interceptor<?>> extractCdiInterceptors(Collection<? extends InterceptorClassMetadata<?>> interceptorMetadatas) { // ignore interceptors which are not CDI interceptors ArrayList<Interceptor<?>> interceptors = new ArrayList<Interceptor<?>>(); for (InterceptorClassMetadata<?> interceptorMetadata : interceptorMetadatas) { InterceptorFactory<?> interceptorFactory = interceptorMetadata.getInterceptorFactory(); if (interceptorFactory instanceof CdiInterceptorFactory<?>) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorFactory; interceptors.add(cdiInterceptorFactory.getInterceptor()); } } return interceptors; }
@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") public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) { return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(), interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null); }
@Override public boolean isEligible(InterceptionType interceptionType) { return factory.getInterceptor().intercepts(javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) { if (interceptorMetadata.getInterceptorFactory() instanceof CdiInterceptorFactory<?> && passivationCapabilityCheckRequired) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor(); beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager(); for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint)); validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean); if (interceptorMetadata.getInterceptorFactory() instanceof PlainInterceptorFactory<?>) { PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Class<?> interceptorClass = interceptorMetadata.getJavaClass();
@Override @SuppressWarnings("unchecked") public InterceptorInvocation getInterceptorInvocation(Object interceptorInstance, InterceptionType interceptionType) { return new CustomInterceptorInvocation<T>(factory.getInterceptor(), (T) interceptorInstance, javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
private List<Interceptor<?>> extractCdiInterceptors(Collection<? extends InterceptorClassMetadata<?>> interceptorMetadatas) { // ignore interceptors which are not CDI interceptors ArrayList<Interceptor<?>> interceptors = new ArrayList<Interceptor<?>>(); for (InterceptorClassMetadata<?> interceptorMetadata : interceptorMetadatas) { InterceptorFactory<?> interceptorFactory = interceptorMetadata.getInterceptorFactory(); if (interceptorFactory instanceof CdiInterceptorFactory<?>) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorFactory; interceptors.add(cdiInterceptorFactory.getInterceptor()); } } return interceptors; }
@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") public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) { return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(), interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null); }
@Override public boolean isEligible(InterceptionType interceptionType) { return factory.getInterceptor().intercepts(javax.enterprise.inject.spi.InterceptionType.valueOf(interceptionType.name())); }
for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) { if (interceptorMetadata.getInterceptorFactory() instanceof CdiInterceptorFactory<?> && passivationCapabilityCheckRequired) { CdiInterceptorFactory<?> cdiInterceptorFactory = (CdiInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor(); beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager(); for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint)); validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean); if (interceptorMetadata.getInterceptorFactory() instanceof PlainInterceptorFactory<?>) { PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory(); Class<?> interceptorClass = interceptorMetadata.getJavaClass();