@Override public void writeExternal(ObjectOutput out) throws IOException { if (pluginConfigurer == null) { throw new IllegalStateException("Serialization not supported from an executor"); } byte[] plugins = getGson().toJson(pluginConfigurer.getPlugins(), PLUGINS_TYPE).getBytes(StandardCharsets.UTF_8); out.writeInt(plugins.length); out.write(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(); }
/** * 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 writeExternal(ObjectOutput out) throws IOException { if (pluginConfigurer == null) { throw new IllegalStateException("Serialization not supported from an executor"); } byte[] plugins = getGson().toJson(pluginConfigurer.getPlugins(), PLUGINS_TYPE).getBytes(StandardCharsets.UTF_8); out.writeInt(plugins.length); out.write(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; }
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; }
@Override public void writeExternal(ObjectOutput out) throws IOException { if (pluginConfigurer == null) { throw new IllegalStateException("Serialization not supported from an executor"); } byte[] plugins = getGson().toJson(pluginConfigurer.getPlugins(), PLUGINS_TYPE).getBytes(StandardCharsets.UTF_8); out.writeInt(plugins.length); out.write(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(); }