Type type = AnnotationUtil.getAnnotatedMethodFirstParameterWithAnnotation(annotatedMethod, Disposes.class);
Annotation[] annot = AnnotationUtil.getAnnotatedMethodFirstParameterQualifierWithGivenAnnotation(annotatedMethod, Disposes.class);
Set<Bean<?>> set = InjectionResolver.getInstance().implResolveByType(type, annot);
if (set.isEmpty()) {
throw new UnsatisfiedResolutionException("Producer method component of the disposal method : " + declaredMethod.getName() +
" in class : " + declaredMethod.getDeclaringClass().getName() + ". Cannot find bean " + type + " with qualifier " + Arrays.toString(annot));
}
Bean<?> foundBean = set.iterator().next();
ProducerMethodBean<?> pr = null;
if (foundBean == null || !(foundBean instanceof ProducerMethodBean))
{
throw new UnsatisfiedResolutionException("Producer method component of the disposal method : " + declaredMethod.getName() + " in class : " + annotatedMethod.getDeclaringType().getJavaClass() + "is not found");
}
pr = (ProducerMethodBean<?>) foundBean;
if (previous == null)