private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
private void initInterceptor(InterceptionType interceptionType, AnnotatedMethod<?> method, Set<Annotation> methodBindingAnnotations) { List<Interceptor<?>> methodBoundInterceptors = manager.resolveInterceptors(interceptionType, methodBindingAnnotations); if (methodBoundInterceptors != null && methodBoundInterceptors.size() > 0) { Method javaMethod = method.getJavaMember(); if (Reflections.isFinal(javaMethod)) { if (configuration.isFinalMethodIgnored(javaMethod.getDeclaringClass().getName())) { BeanLogger.LOG.finalMethodNotIntercepted(javaMethod, methodBoundInterceptors.get(0).getBeanClass().getName()); } else { throw BeanLogger.LOG.finalInterceptedBeanMethodNotAllowed(method, methodBoundInterceptors.get(0).getBeanClass().getName()); } } else { builder.interceptMethod(interceptionType, javaMethod, asInterceptorMetadata(methodBoundInterceptors), methodBindingAnnotations); } } }
/** * Resolves a list of interceptors based on interception type and interceptor bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(null, this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
/** * Resolves a list of interceptors based on interception type and interceptor bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(null, this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
/** * Resolves a list of interceptors based on interception type and interceptor bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(null, this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
/** * Resolves a list of interceptors based on interception type and interceptor bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(null, this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
/** * Resolves a list of interceptors based on interception type and interceptor bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(null, this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }
/** * Resolves a list of interceptors based on interception type and interceptor * bindings. Transitive interceptor bindings of the interceptor bindings passed * as a parameter are considered in the resolution process. * * @param type The interception type to resolve * @param interceptorBindings The binding types to match * @return A list of matching interceptors * @see javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType, * java.lang.annotation.Annotation[]) */ @Override public List<Interceptor<?>> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings) { if (interceptorBindings.length == 0) { throw BeanManagerLogger.LOG.interceptorBindingsEmpty(); } for (Annotation annotation : interceptorBindings) { if (!isInterceptorBinding(annotation.annotationType())) { throw BeanManagerLogger.LOG.notInterceptorBindingType(annotation); } } Set<Annotation> flattenedInterceptorBindings = Interceptors.flattenInterceptorBindings(this, Arrays.asList(interceptorBindings), true, true); return resolveInterceptors(type, flattenedInterceptorBindings); }
private void initLifeCycleInterceptor(InterceptionType interceptionType, AnnotatedConstructor<?> constructor, Set<Annotation> annotations) { List<Interceptor<?>> resolvedInterceptors = manager.resolveInterceptors(interceptionType, annotations); if (!resolvedInterceptors.isEmpty()) { if(constructor != null) { builder.interceptGlobal(interceptionType, constructor.getJavaMember(), asInterceptorMetadata(resolvedInterceptors), annotations); } else { builder.interceptGlobal(interceptionType, null, asInterceptorMetadata(resolvedInterceptors), null); } } }