Class PluginsContainer
PluginsContainer.PluginProvider
special. If it is used with a type, it will expand when it encounters a
PluginsContainer.PluginProvider plugin, see getPlugin(Class) and
getPlugins(Class). These provided plugins are _not_ part of the this
set so they won't be explicitly returned when plugins() is called.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA Plugin Provider provides plugins when accessed with a type selector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Object> collection) protected voidclose()<T> TReturn the first plugin of the specified type.<T> List<T> getPlugins(Class<T> type) Return all plugins of the specified type.protected voidInit actions occur inside of the first-level memoizer.iterator()protected voidloadPlugins(Processor processor, String pluginString, String pluginPathString) Magic to load the plugins.plugins()Return the set of plugins added to this container.protected voidPost init actions must occur outside of the first level memoizer.booleanintsize()protected <T> Spliterator<T> spliterator(Class<T> type) Returns a spliterator of plugins of the specified type ordered by the processor hierarchy.stream()protected <T> Stream<T> Returns a stream of plugins of the specified type ordered by the processor hierarchy.toString()Methods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
clear, contains, containsAll, isEmpty, retainAll, toArray, toArrayMethods inherited from interface Collection
parallelStream, removeIf, toArray
-
Constructor Details
-
PluginsContainer
protected PluginsContainer()
-
-
Method Details
-
init
Init actions occur inside of the first-level memoizer. -
postInit
Post init actions must occur outside of the first level memoizer. This means these actions can reentrantly see the current state of the PluginsContainer, through the Processor, which may be partially complete if addExtensions adds more plugins. -
plugins
Return the set of plugins added to this container.This will include
PluginsContainer.PluginProviders themselves, if any, rather than any plugins thePluginsContainer.PluginProviders may provide.Use
stream(Class)or @{linkspliterator(Class)to return the complete plugins including any plugins thePluginsContainer.PluginProviders may provide as well as the plugins from the parent processor. The complete plugins may have duplicates if the same plugin is added into different processors in the hierarchy. -
stream
-
spliterator
Returns a spliterator of plugins of the specified type ordered by the processor hierarchy.The supplied plugins may have duplicates if the same plugin is added into different processors in the hierarchy.
-
getPlugin
Return the first plugin of the specified type.This may invoke any
PluginsContainer.PluginProviders that match the specified type. -
getPlugins
Return all plugins of the specified type. Duplicates are removed.This will invoke any
PluginsContainer.PluginProviders that match the specified type.- Specified by:
getPluginsin interfaceRegistry
-
add
- Specified by:
addin interfaceCollection<Object>- Specified by:
addin interfaceSet<Object>- Overrides:
addin classAbstractCollection<Object>
-
addAll
- Specified by:
addAllin interfaceCollection<Object>- Specified by:
addAllin interfaceSet<Object>- Overrides:
addAllin classAbstractCollection<Object>
-
remove
- Specified by:
removein interfaceCollection<Object>- Specified by:
removein interfaceSet<Object>- Overrides:
removein classAbstractCollection<Object>
-
iterator
-
spliterator
- Specified by:
spliteratorin interfaceCollection<Object>- Specified by:
spliteratorin interfaceIterable<Object>- Specified by:
spliteratorin interfaceSet<Object>
-
stream
- Specified by:
streamin interfaceCollection<Object>
-
size
public int size()- Specified by:
sizein interfaceCollection<Object>- Specified by:
sizein interfaceSet<Object>- Specified by:
sizein classAbstractCollection<Object>
-
toString
- Overrides:
toStringin classAbstractCollection<Object>
-
loadPlugins
Magic to load the plugins. This is quite tricky actually since we allow plugins to be downloaded (this is mainly intended for repositories since in general plugins should use extensions, however to bootstrap the extensions we need more). Since downloads might need plugins for passwords and protocols we need to first load the paths specified on the plugin clause, then check if there are any local plugins (starting with aQute.bnd and be able to load from our own class loader).After that, we load the plugin paths, these can use the built in connectors.
Last but not least, we load the remaining plugins.
-
close
protected void close()
-