001package io.ebean.config;
002
003/**
004 * Deprecated - migrate to DatabaseConfigProvider.
005 * <p>
006 * Provides a ServiceLoader based mechanism to configure a ServerConfig.
007 * <p>
008 * Provide an implementation and register it via the standard Java ServiceLoader mechanism
009 * via a file at <code>META-INF/services/io.ebean.config.ServerConfigProvider</code>.
010 * <p>
011 * If you are using a DI container like Spring or Guice you are unlikely to use this but instead use a
012 * spring specific configuration.  When we are not using a DI container we may use this mechanism to
013 * explicitly register the entity beans and avoid classpath scanning.
014 * </p>
015 * <pre>{@code
016 *
017 * public class EbeanConfigProvider implements ServerConfigProvider {
018 *
019 *   @Override
020 *   public void apply(ServerConfig config) {
021 *
022 *     // register the entity bean classes explicitly
023 *     config.addClass(Customer.class);
024 *     config.addClass(User.class);
025 *     ...
026 *   }
027 * }
028 *
029 * }</pre>
030 */
031@Deprecated
032public interface ServerConfigProvider {
033
034  /**
035   * Apply the configuration to the ServerConfig.
036   * <p>
037   * Typically we explicitly register entity bean classes and thus avoid classpath scanning.
038   * </p>
039   */
040  void apply(ServerConfig config);
041}