diff --git a/core/src/main/java/org/synyx/hera/core/MutablePluginRegistry.java b/core/src/main/java/org/synyx/hera/core/MutablePluginRegistry.java new file mode 100644 index 0000000..77b972c --- /dev/null +++ b/core/src/main/java/org/synyx/hera/core/MutablePluginRegistry.java @@ -0,0 +1,53 @@ +/* + * Copyright 2002-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package org.synyx.hera.core; + +import java.util.List; + + +/** + * Extension of {@link PluginRegistry} with additional methods to modify the + * registry. + * + * @author Oliver Gierke - gierke@synyx.de + */ +public interface MutablePluginRegistry, S> extends + PluginRegistry { + + /** + * Register plugins. + * + * @param plugins the plugins to set + */ + void setPlugins(List plugins); + + + /** + * Adds a given plugin to the registry. + * + * @param plugin + */ + void addPlugin(T plugin); + + + /** + * Removes a given plugin from the registry. + * + * @param plugin + */ + boolean removePlugin(T plugin); +} diff --git a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java index 73023a7..05e06f1 100644 --- a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java @@ -13,30 +13,6 @@ import java.util.List; */ public interface PluginRegistry, S> extends Iterable { - /** - * Register plugins. - * - * @param plugins the plugins to set - */ - void setPlugins(List plugins); - - - /** - * Adds a given plugin to the registry. - * - * @param plugin - */ - void addPlugin(T plugin); - - - /** - * Removes a given plugin from the registry. - * - * @param plugin - */ - boolean removePlugin(T plugin); - - /** * Returns the first plugin found for the given originating system. Thus, * further configured plugins are ignored. diff --git a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java index fcfd5f0..09ec1a3 100644 --- a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java @@ -30,7 +30,7 @@ import java.util.List; * @author Oliver Gierke - gierke@synyx.de */ public class SimplePluginRegistry, S> implements - PluginRegistry { + MutablePluginRegistry { // Registered plugins private List plugins; @@ -78,7 +78,7 @@ public class SimplePluginRegistry, S> implements /* * (non-Javadoc) * - * @see org.synyx.hera.core.PluginRegistry#setPlugins(java.util.List) + * @see org.synyx.hera.core.MutablePluginRegistry#setPlugins(java.util.List) */ public void setPlugins(List plugins) { @@ -90,7 +90,9 @@ public class SimplePluginRegistry, S> implements /* * (non-Javadoc) * - * @see org.synyx.hera.core.PluginRegistry#addPlugin(T) + * @see + * org.synyx.hera.core.MutablePluginRegistry#addPlugin(org.synyx.hera.core + * .Plugin) */ public void addPlugin(T plugin) { @@ -102,8 +104,8 @@ public class SimplePluginRegistry, S> implements * (non-Javadoc) * * @see - * org.synyx.hera.core.PluginRegistry#removePlugin(org.synyx.hera.core.Plugin - * ) + * org.synyx.hera.core.MutablePluginRegistry#removePlugin(org.synyx.hera + * .core.Plugin) */ public boolean removePlugin(T plugin) {