|
|
@ -56,6 +56,12 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe |
|
|
|
List<ExtensionWrapper<T>> result = new ArrayList<ExtensionWrapper<T>>(); |
|
|
|
List<ExtensionWrapper<T>> result = new ArrayList<ExtensionWrapper<T>>(); |
|
|
|
for (Map.Entry<String, Set<String>> entry : entries.entrySet()) { |
|
|
|
for (Map.Entry<String, Set<String>> entry : entries.entrySet()) { |
|
|
|
String pluginId = entry.getKey(); |
|
|
|
String pluginId = entry.getKey(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PluginWrapper pluginWrapper = pluginManager.getPlugin(pluginId); |
|
|
|
|
|
|
|
if (PluginState.STARTED != pluginWrapper.getPluginState()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Set<String> extensionClassNames = entry.getValue(); |
|
|
|
Set<String> extensionClassNames = entry.getValue(); |
|
|
|
|
|
|
|
|
|
|
|
for (String className : extensionClassNames) { |
|
|
|
for (String className : extensionClassNames) { |
|
|
@ -92,9 +98,11 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Set<String> findClassNames(String pluginId) { |
|
|
|
public Set<String> findClassNames(String pluginId) { |
|
|
|
|
|
|
|
readIndexFiles(); |
|
|
|
return entries.get(pluginId); |
|
|
|
return entries.get(pluginId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void pluginStateChanged(PluginStateEvent event) { |
|
|
|
public void pluginStateChanged(PluginStateEvent event) { |
|
|
|
// TODO optimize (do only for some transitions)
|
|
|
|
// TODO optimize (do only for some transitions)
|
|
|
|
// clear cache
|
|
|
|
// clear cache
|
|
|
@ -134,8 +142,8 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe |
|
|
|
|
|
|
|
|
|
|
|
entries = new HashMap<String, Set<String>>(); |
|
|
|
entries = new HashMap<String, Set<String>>(); |
|
|
|
|
|
|
|
|
|
|
|
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins(); |
|
|
|
List<PluginWrapper> plugins = pluginManager.getPlugins(); |
|
|
|
for (PluginWrapper plugin : startedPlugins) { |
|
|
|
for (PluginWrapper plugin : plugins) { |
|
|
|
String pluginId = plugin.getDescriptor().getPluginId(); |
|
|
|
String pluginId = plugin.getDescriptor().getPluginId(); |
|
|
|
log.debug("Reading extensions index file for plugin '{}'", pluginId); |
|
|
|
log.debug("Reading extensions index file for plugin '{}'", pluginId); |
|
|
|
Set<String> entriesPerPlugin = new HashSet<String>(); |
|
|
|
Set<String> entriesPerPlugin = new HashSet<String>(); |
|
|
@ -164,7 +172,7 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe |
|
|
|
return entries; |
|
|
|
return entries; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isExtensionPoint(Class type) { |
|
|
|
private boolean isExtensionPoint(Class<?> type) { |
|
|
|
return ExtensionPoint.class.isAssignableFrom(type); |
|
|
|
return ExtensionPoint.class.isAssignableFrom(type); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|