* 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
This commit is contained in:
Oliver Gierke
2010-01-11 14:23:18 +00:00
parent ee20f0f1e0
commit 4944e4259c
2 changed files with 12 additions and 4 deletions

View File

@@ -109,4 +109,14 @@ public interface PluginRegistry<T extends Plugin<S>, S> extends Iterable<T> {
* @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<? extends Plugin<S>> getPlugins();
}

View File

@@ -229,14 +229,12 @@ public class SimplePluginRegistry<T extends Plugin<S>, 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.
* <p>
* TODO: decide whether to make this method public
*
* @return all plugins of the registry
*/
protected List<? extends T> getPlugins() {
public List<? extends T> getPlugins() {
return plugins;
return Collections.unmodifiableList(plugins);
}