pluginType.searchPlugins(); pluginType.handlePluginAnnotation( clazz, annotation, new ArrayList<>(), true, null ); LogChannel.GENERAL.logBasic( "Plugin class " + className + " registered for plugin type '" + pluginType.getName() + "'" ); } else { if ( KettleLogStore.isInitialized() && LogChannel.GENERAL.isDebug() ) { LogChannel.GENERAL.logDebug( "Plugin class " + className + " doesn't contain annotation for plugin type '" + pluginType.getName() + "'" ); if ( KettleLogStore.isInitialized() && LogChannel.GENERAL.isDebug() ) { LogChannel.GENERAL.logDebug( "Plugin class " + className + " doesn't contain valid class for plugin type '" + pluginType.getName() + "'" ); + getPlugins( pluginType.getClass() ).size() + " plugins of type '" + pluginType.getName() + "' in " + ( System.currentTimeMillis() - startScan ) + "ms." );
/** * Show a plugin browser */ public void showPluginInfo() { try { // First we collect information concerning all the plugin types... // Map<String, RowMetaInterface> metaMap = new HashMap<>(); Map<String, List<Object[]>> dataMap = new HashMap<>(); PluginRegistry registry = PluginRegistry.getInstance(); List<Class<? extends PluginTypeInterface>> pluginTypeClasses = registry.getPluginTypes(); for ( Class<? extends PluginTypeInterface> pluginTypeClass : pluginTypeClasses ) { PluginTypeInterface pluginTypeInterface = registry.getPluginType( pluginTypeClass ); if ( pluginTypeInterface.isFragment() ) { continue; } String subject = pluginTypeInterface.getName(); RowBuffer pluginInformation = registry.getPluginInformation( pluginTypeClass ); metaMap.put( subject, pluginInformation.getRowMeta() ); dataMap.put( subject, pluginInformation.getBuffer() ); } // Now push it all to a subject data browser... // SubjectDataBrowserDialog dialog = new SubjectDataBrowserDialog( shell, metaMap, dataMap, "Plugin browser", "Plugin type" ); dialog.open(); } catch ( Exception e ) { new ErrorDialog( shell, "Error", "Error listing plugins", e ); } }
public String getPluginsMessage() { StringBuilder message = new StringBuilder(); for ( PluginDetails details : missingPluginDetailsList ) { message.append( Const.CR ); try { PluginTypeInterface pluginType = PluginRegistry.getInstance().getPluginType( details.pluginTypeClass ); message.append( pluginType.getName() ); } catch ( Exception e ) { message.append( "UnknownPluginType-" ).append( details.pluginTypeClass.getName() ); } message.append( " : " ).append( details.pluginId ); } return message.toString(); }
/** * @param pluginType the type of plugin to get information for * @return a row buffer containing plugin information for the given plugin type * @throws KettlePluginException */ public RowBuffer getPluginInformation( Class<? extends PluginTypeInterface> pluginType ) throws KettlePluginException { RowBuffer rowBuffer = new RowBuffer( getPluginInformationRowMeta() ); for ( PluginInterface plugin : getPlugins( pluginType ) ) { Object[] row = new Object[getPluginInformationRowMeta().size()]; int rowIndex = 0; row[rowIndex++] = getPluginType( plugin.getPluginType() ).getName(); row[rowIndex++] = plugin.getIds()[0]; row[rowIndex++] = plugin.getName(); row[rowIndex++] = Const.NVL( plugin.getDescription(), "" ); row[rowIndex++] = Utils.isEmpty( plugin.getLibraries() ) ? "" : plugin.getLibraries().toString(); row[rowIndex++] = Const.NVL( plugin.getImageFile(), "" ); row[rowIndex++] = plugin.getClassMap().values().toString(); row[rowIndex] = Const.NVL( plugin.getCategory(), "" ); rowBuffer.getBuffer().add( row ); } return rowBuffer; }