From 4944e4259c45df1686629c463c73f92c43dabc68 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 11 Jan 2010 14:23:18 +0000 Subject: [PATCH] * added @getPlugins@ method to @PluginRegistry@ interface git-svn-id: svn+ssh://svn.synyx.de/var/svn/synyx/opensource/hera/trunk@8542 5a64d73e-33d6-4ccc-9058-23f8668ecac9 --- .../main/java/org/synyx/hera/core/PluginRegistry.java | 10 ++++++++++ .../java/org/synyx/hera/core/SimplePluginRegistry.java | 6 ++---- 2 files changed, 12 insertions(+), 4 deletions(-) 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 05e06f1..dd8ad8f 100644 --- a/core/src/main/java/org/synyx/hera/core/PluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/PluginRegistry.java @@ -109,4 +109,14 @@ public interface PluginRegistry, S> extends Iterable { * @return */ boolean hasPluginFor(S delimiter); + + + /** + * Returns all {@link Plugin}s contained in this registry. Will return an + * immutable {@link List} to prevent outside modifications of the + * {@link PluginRegistry} content. + * + * @return + */ + List> getPlugins(); } \ No newline at end of file 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 8a91e24..881b3d4 100644 --- a/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java +++ b/core/src/main/java/org/synyx/hera/core/SimplePluginRegistry.java @@ -229,14 +229,12 @@ public class SimplePluginRegistry, S> implements * to access all plugins. For distinguished access to certain plugins favour * accessor methods like {link #getPluginFor} over this one. This method * should only be used for testing purposes to check registry configuration. - *

- * TODO: decide whether to make this method public * * @return all plugins of the registry */ - protected List getPlugins() { + public List getPlugins() { - return plugins; + return Collections.unmodifiableList(plugins); }