/** * The plugin label is used in logging and it's a string in format {@code pluginId@pluginVersion}. */ protected String getPluginLabel(PluginDescriptor pluginDescriptor) { return pluginDescriptor.getPluginId() + "@" + pluginDescriptor.getVersion(); }
/** * Override this to change the validation criteria. * * @param descriptor the plugin descriptor to validate * @throws PluginException if validation fails */ protected void validatePluginDescriptor(PluginDescriptor descriptor) throws PluginException { if (StringUtils.isNullOrEmpty(descriptor.getPluginId())) { throw new PluginException("Field 'id' cannot be empty"); } if (descriptor.getVersion() == null) { throw new PluginException("Field 'version' cannot be empty"); } }
String existingVersion = plugin.getVersion();
/** * The plugin label is used in logging and it's a string in format {@code pluginId@pluginVersion}. */ protected String getPluginLabel(PluginDescriptor pluginDescriptor) { return pluginDescriptor.getPluginId() + "@" + pluginDescriptor.getVersion(); }
/** * show the started plugins */ public void showStartedPlugins() { List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins(); for (PluginWrapper plugin : startedPlugins) { PluginDescriptor descriptor = plugin.getDescriptor(); String pluginId = plugin.getDescriptor().getPluginId(); String msg = String.format( "Extensions added by plugin id:'%s' version:'%s' %s:", pluginId, descriptor.getVersion(), descriptor.getPluginDescription()); if (debug) LOGGER.log(Level.INFO, msg); Set<String> extensionClassNames = pluginManager .getExtensionClassNames(pluginId); for (String extension : extensionClassNames) { msg = " " + extension; if (debug) LOGGER.log(Level.INFO, msg); } } }
/** * Override this to change the validation criteria. * * @param descriptor the plugin descriptor to validate * @throws PluginException if validation fails */ protected void validatePluginDescriptor(PluginDescriptor descriptor) throws PluginException { if (StringUtils.isNullOrEmpty(descriptor.getPluginId())) { throw new PluginException("Field 'id' cannot be empty"); } if (descriptor.getVersion() == null) { throw new PluginException("Field 'version' cannot be empty"); } }
String existingVersion = plugin.getVersion();