title: When to use Spring @ConfigurationCondition vs. @Condition?
body: <p>Spring 4 has two new annotations <code>@Condition</code> and <code>@ConfigurationConditon</code> for controlling whether a bean is added to the spring application context. The JavaDoc does not provide enough context / big picture to understand the use cases for <code>@ConfigurationCondition</code>. </p>
  
  <p>When should <code>@ConfigurationCondition</code> be used vs. <code>@Condition</code>?</p>
  
  <pre><code>public interface ConfigurationCondition extends Condition {
  
      /**
       * Returns the {@link ConfigurationPhase} in which the condition should be evaluated.
       */
      ConfigurationPhase getConfigurationPhase();
  
      /**
       * The various configuration phases where the condition could be evaluated.
       */
      public static enum ConfigurationPhase {
  
          /**
           * The {@link Condition} should be evaluated as a {@code @Configuration} class is
           * being parsed.
           *
           * &lt;p&gt;If the condition does not match at this point the {@code @Configuration}
           * class will not be added.
           */
          PARSE_CONFIGURATION,
  
          /**
           * The {@link Condition} should be evaluated when adding a regular (non
           * {@code @Configuration}) bean. The condition will not prevent
           * {@code @Configuration} classes from being added.
           *
           * &lt;p&gt;At the time that the condition is evaluated all {@code @Configuration}s
           * will have been parsed.
           */
          REGISTER_BEAN
      }
  
  }
  </code></pre>