class MonitorComponentConditional implements ConfigurationCondition {

    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        Environment env = context.getEnvironment();
        MultiValueMap<String, Object> map = metadata
            .getAllAnnotationAttributes(ConditionalOnMonitorComponent.class.getName());
        List<Object> value = map.get("value");
        if (CollectionUtils.isEmpty(value)) {
            return false;
        }
        String componentName = (String) value.get(0);
        List<String> activeComponents = getComponents(context);
        boolean active = activeComponents.contains(componentName);

        active = active ? isActiveByZoneInfo(env, componentName) : false;

        LOGGER.info("monitor component:{}, active:{}", componentName, active);
        return active;
    }

}