Spring 4 부터 사용 가능하며 Java Configuration 에서 조건적으로 Spring Bean 을 등록할 수 있다.

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Conditional {

    /**
     * All {@link Condition}s that must {@linkplain Condition#matches match}
     * in order for the component to be registered.
     */
    Class? extends Condition[] value();

}

// Condtion.class
public interface Condition {
  boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata);
}

https://cornswrold.tistory.com/367