From e683e25a95e288b39d0fa3a95cd7834693fb2395 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Wed, 13 Jun 2018 21:35:26 +1200 Subject: [PATCH] #1420 - ENH: Add a ServiceLoader mechanism to configure ServerConfig - io.ebean.config.ServerConfigProvider --- src/main/java/io/ebean/config/ServerConfig.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/ebean/config/ServerConfig.java b/src/main/java/io/ebean/config/ServerConfig.java index 222129a65..bfb0b3999 100644 --- a/src/main/java/io/ebean/config/ServerConfig.java +++ b/src/main/java/io/ebean/config/ServerConfig.java @@ -57,22 +57,24 @@ import java.util.ServiceLoader; *
{@code
  *
  * ServerConfig c = new ServerConfig();
- * c.setName("db");
  *
  * // read the ebean.properties and load
  * // those settings into this serverConfig object
  * c.loadFromProperties();
  *
- * // add any classes found in the app.data package
- * c.addPackage("com.myapp.domain");
- *
- * // register as the 'Default' server
- * c.setDefaultServer(true);
+ * // explicitly register the entity beans to avoid classpath scanning
+ * c.addClass(Customer.class);
+ * c.addClass(User.class);
  *
  * EbeanServer server = EbeanServerFactory.create(c);
  *
  * }
* + *

+ * Note that ServerConfigProvider provides a standard Java ServiceLoader mechanism that can + * be used to apply configuration to the ServerConfig. + *

+ * * @author emcgreal * @author rbygrave * @see EbeanServerFactory