#633 - Remove deprecated SpiEbeanPlugin (people should have migrated to com.avaje.ebean.plugin.Plugin)

This commit is contained in:
Robin Bygrave
2016-04-01 15:07:49 +13:00
parent 27602c15b9
commit d25123eb23
2 changed files with 0 additions and 57 deletions
@@ -1,25 +0,0 @@
package com.avaje.ebeaninternal.api;
import com.avaje.ebean.config.ServerConfig;
/**
* Allows us to have more than one plugin (the ddl generator) active based on flags.
*
* author: Richard Vowles - http://gplus.to/RichardVowles
*/
@Deprecated
public interface SpiEbeanPlugin {
/**
* initializes the plugin.
*
* @param server - the ebean server with extensions for all of the Ebean internals
* @param serverConfig - the configured server information. It allows access to pre-collected information (but not the collector PropertySource, yet)
*/
void setup(SpiEbeanServer server, ServerConfig serverConfig);
/**
* Execute the plugin (generate DDL for example).
*/
void execute(boolean online);
}
@@ -28,7 +28,6 @@ import com.avaje.ebeaninternal.api.LoadManyRequest;
import com.avaje.ebeaninternal.api.ScopeTrans;
import com.avaje.ebeaninternal.api.ScopedTransaction;
import com.avaje.ebeaninternal.api.SpiBackgroundExecutor;
import com.avaje.ebeaninternal.api.SpiEbeanPlugin;
import com.avaje.ebeaninternal.api.SpiEbeanServer;
import com.avaje.ebeaninternal.api.SpiQuery;
import com.avaje.ebeaninternal.api.SpiQuery.Type;
@@ -177,11 +176,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
private final int queryBatchSize;
/**
* holds plugins (e.g. ddl generator) detected by the service loader
*/
private List<SpiEbeanPlugin> ebeanPlugins;
private final boolean updateAllPropertiesInBatch;
private final boolean collectQueryOrigins;
@@ -242,9 +236,6 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
this.serverPlugins = config.getPlugins();
this.ddlGenerator = new DdlGenerator(this, serverConfig);
// load normal plugins late and call setup on all
loadAndInitializePlugins(config.getServerConfig());
configureServerPlugins();
// Register with the JVM Shutdown hook
@@ -260,35 +251,12 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
}
}
protected void loadAndInitializePlugins(ServerConfig config) {
List<SpiEbeanPlugin> spiPlugins = new ArrayList<SpiEbeanPlugin>();
for (SpiEbeanPlugin plugin : ServiceLoader.load(SpiEbeanPlugin.class)) {
spiPlugins.add(plugin);
plugin.setup(this, config);
}
ebeanPlugins = Collections.unmodifiableList(spiPlugins);
}
/**
* Return the list of registered plugins.
*/
public List<SpiEbeanPlugin> getSpiEbeanPlugins() {
return ebeanPlugins;
}
/**
* Execute all the plugins with an online flag indicating the DB is up or not.
*/
public void executePlugins(boolean online) {
ddlGenerator.execute(online);
for (SpiEbeanPlugin plugin : ebeanPlugins) {
plugin.execute(online);
}
for (Plugin plugin : serverPlugins) {
plugin.online(online);
}