T - the concrete plugin interfaceS - the delimiter typepublic class SimplePluginRegistry<T extends Plugin<S>,S> extends PluginRegistrySupport<T,S>
PluginRegistry. Simply holds all given plugins in a list dropping null
values silently on adding.| Modifier | Constructor and Description |
|---|---|
protected |
SimplePluginRegistry(List<? extends T> plugins)
Creates a new
SimplePluginRegistry. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(T plugin)
Returns whether the registry contains a given plugin.
|
int |
countPlugins()
Returns the number of registered plugins.
|
static <S,T extends Plugin<S>> |
create()
Creates a new
SimplePluginRegistry. |
static <S,T extends Plugin<S>> |
create(List<? extends T> plugins)
Creates a new
SimplePluginRegistry with the given Plugin s. |
T |
getPluginFor(S delimiter)
Returns the first plugin found for the given originating system.
|
<E extends Exception> |
getPluginFor(S delimiter,
E ex)
Retrieves a required plugin from the registry or throw the given exception if none can be found.
|
T |
getPluginFor(S delimiter,
T plugin)
Returns the first
Plugin supporting the given delimiter or the given plugin if none can be found. |
List<T> |
getPlugins()
Returns all registered plugins.
|
List<T> |
getPluginsFor(S delimiter)
Returns all plugins for the given delimiter.
|
<E extends Exception> |
getPluginsFor(S delimiter,
E ex)
Retrieves all plugins for the given delimiter or throws an exception if no plugin can be found.
|
List<T> |
getPluginsFor(S delimiter,
List<? extends T> plugins)
Returns all
Plugins supporting the given delimiter or the given plugins if none found. |
boolean |
hasPluginFor(S delimiter)
Returns whether the registry contains a
Plugin matching the given delimiter. |
initialize, iteratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create()
SimplePluginRegistry.T - the plugin typeS - the delimiter typepublic static <S,T extends Plugin<S>> SimplePluginRegistry<T,S> create(List<? extends T> plugins)
SimplePluginRegistry with the given Plugin s.T - the plugin typeS - the delimiter typepublic List<T> getPlugins()
PluginRegistrySupportgetPlugins in interface PluginRegistry<T extends Plugin<S>,S>getPlugins in class PluginRegistrySupport<T extends Plugin<S>,S>public T getPluginFor(S delimiter)
PluginRegistrynull if none foundpublic List<T> getPluginsFor(S delimiter)
PluginRegistrypublic <E extends Exception> T getPluginFor(S delimiter, E ex) throws E extends Exception
PluginRegistryE - the exception type to be thrown in case no plugin can be foundex - the exception to be thrown in case no plugin can be foundE - if no plugin can be found for the given delimiterE extends Exceptionpublic <E extends Exception> List<T> getPluginsFor(S delimiter, E ex) throws E extends Exception
PluginRegistryE - the exception type to be thrownE - if no plugin can be foundE extends Exceptionpublic T getPluginFor(S delimiter, T plugin)
PluginRegistryPlugin supporting the given delimiter or the given plugin if none can be found.public List<T> getPluginsFor(S delimiter, List<? extends T> plugins)
PluginRegistryPlugins supporting the given delimiter or the given plugins if none found.public int countPlugins()
PluginRegistrypublic boolean contains(T plugin)
PluginRegistrypublic boolean hasPluginFor(S delimiter)
PluginRegistryPlugin matching the given delimiter.Copyright © 2008-2015–2015 Pivotal Software, Inc.. All rights reserved.