@Override public PluginProperties getPluginProperties(String pluginId, MacroEvaluator evaluator) { Plugin plugin = getPlugin(pluginId); if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } return pluginInstantiator.substituteMacros(plugin, evaluator); }
@Override public <T> T newPluginInstance(String pluginId) throws InstantiationException { return newPluginInstance(pluginId, null); }
PluginContext pluginContext = new DefaultPluginContext(instantiator, NamespaceId.DEFAULT.app("abc").worker("w"), ImmutableMap.of(pluginId, pluginInfo));
this.pluginContext = new DefaultPluginContext(pluginInstantiator, program.getId(), program.getApplicationSpecification().getPlugins());
this.pluginContext = new DefaultPluginContext(pluginInstantiator, program.getId(), program.getApplicationSpecification().getPlugins());
@Override public PluginProperties getPluginProperties(String pluginId) { return getPlugin(pluginId).getProperties(); }
@Override public <T> T newPluginInstance(String pluginId) throws InstantiationException { return newPluginInstance(pluginId, null); }
@Override public PluginProperties getPluginProperties(String pluginId) { return getPlugin(pluginId).getProperties(); }
@Override public PluginProperties getPluginProperties(String pluginId, MacroEvaluator evaluator) { Plugin plugin = getPlugin(pluginId); if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } return pluginInstantiator.substituteMacros(plugin, evaluator); }
@Override public <T> T newPluginInstance(String pluginId, @Nullable MacroEvaluator evaluator) throws InstantiationException { try { Plugin plugin = getPlugin(pluginId); if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } return pluginInstantiator.newInstance(plugin, evaluator); } catch (ClassNotFoundException e) { // Shouldn't happen, unless there is bug in file localization throw new IllegalArgumentException("Plugin class not found", e); } catch (IOException e) { // This is fatal, since jar cannot be expanded. throw Throwables.propagate(e); } }
@Override public <T> Class<T> loadPluginClass(String pluginId) { try { if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } Plugin plugin = getPlugin(pluginId); return pluginInstantiator.loadClass(plugin); } catch (ClassNotFoundException e) { // Shouldn't happen, unless there is bug in file localization throw new IllegalArgumentException("Plugin class not found", e); } catch (IOException e) { // This is fatal, since jar cannot be expanded. throw Throwables.propagate(e); } }
@Override public <T> T newPluginInstance(String pluginId, @Nullable MacroEvaluator evaluator) throws InstantiationException { try { Plugin plugin = getPlugin(pluginId); if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } return pluginInstantiator.newInstance(plugin, evaluator); } catch (ClassNotFoundException e) { // Shouldn't happen, unless there is bug in file localization throw new IllegalArgumentException("Plugin class not found", e); } catch (IOException e) { // This is fatal, since jar cannot be expanded. throw Throwables.propagate(e); } }
@Override public <T> Class<T> loadPluginClass(String pluginId) { try { if (pluginInstantiator == null) { throw new UnsupportedOperationException("Plugin is not supported"); } Plugin plugin = getPlugin(pluginId); return pluginInstantiator.loadClass(plugin); } catch (ClassNotFoundException e) { // Shouldn't happen, unless there is bug in file localization throw new IllegalArgumentException("Plugin class not found", e); } catch (IOException e) { // This is fatal, since jar cannot be expanded. throw Throwables.propagate(e); } }