From d25123eb23e7290a3f9672be51525d568406a85d Mon Sep 17 00:00:00 2001 From: Robin Bygrave Date: Fri, 1 Apr 2016 15:07:49 +1300 Subject: [PATCH] #633 - Remove deprecated SpiEbeanPlugin (people should have migrated to com.avaje.ebean.plugin.Plugin) --- .../ebeaninternal/api/SpiEbeanPlugin.java | 25 --------------- .../server/core/DefaultServer.java | 32 ------------------- 2 files changed, 57 deletions(-) delete mode 100644 src/main/java/com/avaje/ebeaninternal/api/SpiEbeanPlugin.java diff --git a/src/main/java/com/avaje/ebeaninternal/api/SpiEbeanPlugin.java b/src/main/java/com/avaje/ebeaninternal/api/SpiEbeanPlugin.java deleted file mode 100644 index 094d166f3..000000000 --- a/src/main/java/com/avaje/ebeaninternal/api/SpiEbeanPlugin.java +++ /dev/null @@ -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); -} diff --git a/src/main/java/com/avaje/ebeaninternal/server/core/DefaultServer.java b/src/main/java/com/avaje/ebeaninternal/server/core/DefaultServer.java index 7f9605154..0581b97b9 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/core/DefaultServer.java +++ b/src/main/java/com/avaje/ebeaninternal/server/core/DefaultServer.java @@ -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 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 spiPlugins = new ArrayList(); - - 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 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); }