title: auto-configuration adding PropertySource in spring-boot
body: <p>I want to add a custom PropertySource (the class, not annotation). Annotation is not sufficient as it only handles file sources.</p>
  
  <p>The approach which works is to define own ApplicationContextInitializer and add proper declaration to META-INF/spring.factories. ApplicationContextInitializer  just uses:
  <code>
  Environment.getPropertySources().addLast(...)
  </code>
  But there are some drawbacks, mainly:</p>
  
  <ul>
  <li>It is always run, but the preferable behaviour would be to only run if certain conditions are met (@ConditionalOnClass, etc)</li>
  </ul>
  
  <p>How to achieve that? Ideally I'd write my autoconfiguration with @Condition... annotations and inside declare such initializer (preferably Ordered).</p>
  
  <p>Edit:
  In my particular case I want to define Archaius PolledConfigurationSource, but only if Archaius is on the classpath - that's why I'd like to use @ConditionalOnClass together with a listener on an event very early in the lifecycle.</p>