/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }
/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }
public Map<String, Plugin> getPlugins() { Map<String, Plugin> plugins = pluginConfigurer.getPlugins().entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getPlugin())); plugins.putAll(extraPlugins); return plugins; }
public Map<String, Plugin> getPlugins() { Map<String, Plugin> plugins = pluginConfigurer.getPlugins().entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getPlugin())); plugins.putAll(extraPlugins); return plugins; }
/** * Returns the {@link Plugin} information for the given plugin id that were configured via this context. */ private Plugin getExtraPlugin(String pluginId) { // Get the map of plugins from either the configurer (handler method) or the extra plugins map (executor) Map<String, PluginWithLocation> plugins = pluginConfigurer == null ? extraPlugins : pluginConfigurer.getPlugins(); PluginWithLocation plugin = plugins.get(pluginId); if (plugin == null) { throw new IllegalArgumentException("Plugin with id " + pluginId + " does not exist"); } return plugin.getPlugin(); }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int len = in.readInt(); byte[] bytes = new byte[len]; in.readFully(bytes); Map<String, PluginWithLocation> plugins = getGson().fromJson(new InputStreamReader(new ByteArrayInputStream(bytes), StandardCharsets.UTF_8), PLUGINS_TYPE); extraPlugins.putAll(plugins); for (PluginWithLocation plugin : plugins.values()) { pluginInstantiator.addArtifact(plugin.getArtifactLocation(), plugin.getPlugin().getArtifactId()); } }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int len = in.readInt(); byte[] bytes = new byte[len]; in.readFully(bytes); Map<String, PluginWithLocation> plugins = getGson().fromJson(new InputStreamReader(new ByteArrayInputStream(bytes), StandardCharsets.UTF_8), PLUGINS_TYPE); extraPlugins.putAll(plugins); for (PluginWithLocation plugin : plugins.values()) { pluginInstantiator.addArtifact(plugin.getArtifactLocation(), plugin.getPlugin().getArtifactId()); } }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { int len = in.readInt(); byte[] bytes = new byte[len]; in.readFully(bytes); Map<String, PluginWithLocation> plugins = getGson().fromJson(new InputStreamReader(new ByteArrayInputStream(bytes), StandardCharsets.UTF_8), PLUGINS_TYPE); extraPlugins.putAll(plugins); for (PluginWithLocation plugin : plugins.values()) { pluginInstantiator.addArtifact(plugin.getArtifactLocation(), plugin.getPlugin().getArtifactId()); } }