/** * Records metric producer methods defined by the application. Ignores producers * with non-default qualifiers and library producers. * * @param ppm Producer method. */ private void recordProducerMethods(@Observes ProcessProducerMethod<? extends org.eclipse.microprofile.metrics.Metric, ?> ppm) { LOGGER.log(Level.FINE, () -> "### recordProducerMethods " + ppm.getBean().getBeanClass()); if (!MetricProducer.class.equals(ppm.getBean().getBeanClass())) { Metric metric = ppm.getAnnotatedProducerMethod().getAnnotation(Metric.class); if (metric != null) { Optional<? extends Annotation> hasQualifier = ppm.getAnnotatedProducerMethod() .getAnnotations() .stream() .filter(annotation -> annotation.annotationType().isAnnotationPresent(Qualifier.class)) .findFirst(); // Ignore producers with non-default qualifiers if (!hasQualifier.isPresent() || hasQualifier.get() instanceof Default) { producers.put(ppm.getBean(), ppm.getAnnotatedProducerMethod()); } } } }
@Override public Set<Annotation> getAnnotations() { return method.getAnnotations(); }
InjectionPointHandler getInjectionPointHandler(AnnotatedMethod<?> method) { // InjectIntrospector.introspect(_injectProgramList, field); for (Annotation ann : method.getAnnotations()) { Class<? extends Annotation> annType = ann.annotationType(); InjectionPointHandler handler = _injectionMap.get(annType); if (handler != null) { return handler; } } return null; }
public FilterableMethod(final AnnotatedMethod<T> method) { this.original = method; this.annotations = new HashSet<Annotation>(method.getAnnotations()); this.annotations.add(FILTERABLE); }
private void initCdiBusinessMethodInterceptors(Map<Class<? extends Annotation>, Annotation> classBindingAnnotations) { for (AnnotatedMethod<?> method : businessMethods) { initCdiBusinessMethodInterceptor(method, getMemberBindingAnnotations(classBindingAnnotations, method.getAnnotations())); } }
/** * Copy ct for Configurators */ AnnotatedMethodImpl(WebBeansContext webBeansContext, AnnotatedMethod<? super X> originalAnnotatedMethod, AnnotatedType<X> declaringType) { super(webBeansContext, originalAnnotatedMethod.getBaseType(), originalAnnotatedMethod.getJavaMember(), declaringType); getAnnotations().addAll(originalAnnotatedMethod.getAnnotations()); for (AnnotatedParameter<? super X> originalAnnotatedParameter : originalAnnotatedMethod.getParameters()) { getParameters().add(new AnnotatedParameterImpl(webBeansContext, originalAnnotatedParameter, this)); } }
public AnnotatedMethodImpl(AnnotatedMethod<? super T> method, AnnotatedType<T> declaringType) { this(method.getBaseType(), method.getTypeClosure(), method.getAnnotations(), declaringType, method.getJavaMember(), method.isStatic()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public AnnotatedMethodImpl(AnnotatedMethod<? super T> method, AnnotatedType<T> declaringType) { this(method.getBaseType(), method.getTypeClosure(), method.getAnnotations(), declaringType, method.getJavaMember(), method.isStatic()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public static String formatAnnotatedMethod(AnnotatedMethod<?> method) { return Formats.formatSimpleClassName(method) + " " + Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())) + Formats.addSpaceIfNeeded(Formats.formatModifiers(method.getJavaMember().getModifiers())) + method.getDeclaringType().getJavaClass().getName() + "." + method.getJavaMember().getName() + Formats.formatAsFormalParameterList(method.getParameters()); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }
public static <X, Y extends X> AnnotatedMethod<X> of(AnnotatedMethod<X> originalMethod, UnbackedAnnotatedType<Y> declaringType, SharedObjectCache cache) { UnbackedAnnotatedType<X> downcastDeclaringType = cast(declaringType); return new UnbackedAnnotatedMethod<X>(originalMethod.getBaseType(), originalMethod.getTypeClosure(), originalMethod.getAnnotations(), downcastDeclaringType, originalMethod.getParameters(), originalMethod.getJavaMember(), cache); }