diff --git a/src/main/java/com/avaje/ebean/config/ServerConfig.java b/src/main/java/com/avaje/ebean/config/ServerConfig.java index 9322e29a2..fc6f3fc65 100644 --- a/src/main/java/com/avaje/ebean/config/ServerConfig.java +++ b/src/main/java/com/avaje/ebean/config/ServerConfig.java @@ -26,8 +26,10 @@ import org.avaje.datasource.DataSourceConfig; import javax.sql.DataSource; import java.util.ArrayList; +import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.Properties; import java.util.ServiceLoader; @@ -82,6 +84,12 @@ public class ServerConfig { */ private String name; + /** + * Typically configuration type objects that are passed by this ServerConfig + * to plugins. For example - IgniteConfiguration passed to Ignite plugin. + */ + private Map serviceObject = new HashMap(); + private ContainerConfig containerConfig; /** @@ -403,6 +411,23 @@ public class ServerConfig { public ServerConfig() { } + + /** + * Put a service object into configuration such that it can be passed to a plugin. + *

+ * For example, put IgniteConfiguration in to be passed to the Ignite plugin. + *

+ */ + public void putServiceObject(String key, Object configObject) { + serviceObject.put(key, configObject); + } + + /** + * Return the service object given the key. + */ + public Object getServiceObject(String key) { + return serviceObject.get(key); + } /** * Return the Jackson JsonFactory to use.