public boolean isTarget(final SpringBeansTargetScope scope, final String beanName, final BeanDefinition beanDefinition) {
        if (scope == null || beanName == null || beanDefinition == null) {
            return false;
        }

        final String className = beanDefinition.getBeanClassName();
        if (className == null) {
            return false;
        }

        if (cache.contains(className)) {
            return false;
        }

        for (SpringBeansTarget target : targets) {
            // check scope.
            if (target.getScope() != scope) {
                continue;
            }

            boolean condition = false;
            // check base packages.
            final List<String> basePackages = target.getBasePackages();
            if (CollectionUtils.hasLength(basePackages)) {
                if (!isBasePackage(target, className)) {
                    continue;
                }
                condition = true;
            }

            // check bean name pattern.
            final List<PathMatcher> namePatterns = target.getNamePatterns();
            if (CollectionUtils.hasLength(namePatterns)) {
                if (!isBeanNameTarget(target, beanName)) {
                    continue;
                }
                condition = true;
            }

            // check class name pattern.
            final List<PathMatcher> classPatterns = target.getClassPatterns();
            if (CollectionUtils.hasLength(classPatterns)) {
                if (!isClassNameTarget(target, className)) {
                    continue;
                }
                condition = true;
            }

            // check class annotation.
            final List<String> annotations = target.getAnnotations();
            if (CollectionUtils.hasLength(annotations)) {
                if (!(beanDefinition instanceof AnnotatedBeanDefinition) || !isAnnotationTarget(target, (AnnotatedBeanDefinition) beanDefinition)) {
                    continue;
                }
                condition = true;
            }

            if (condition) {
                // AND condition.
                return true;
            }
        }

        return false;
    }
@author Jongho Moon <jongho.moon@navercorp.com>
@author jaehong.kim
agent-module/plugins/spring/src/main/java/com/navercorp/pinpoint/plugin/spring/beans/interceptor/TargetBeanFilter.java