try {
this.pluginListLock.lock();
for (final Plugin plugin : this.pluginRegistry.getAllPlugins()) {
// Check the meta information for this plugin. We only want active classes
final PluggableMetaInformation metaInformation = this.pluginRegistry.getMetaInformationFor(plugin);
if (metaInformation.pluginStatus != PluginStatus.ACTIVE) continue;
// Check if the plugin can be assigned to the requested class
if (requestedPlugin.isAssignableFrom(plugin.getClass())) {
if (selector.selectPlugin((P) plugin)) return (P) plugin;