@Override public String toString() { // The rule name with an indication of whether or not this rule is enabled should do for now. // String pluginId = PluginRegistry.getInstance().getPluginId( this ); PluginInterface plugin = PluginRegistry.getInstance().findPluginWithId( ImportRulePluginType.class, pluginId ); return plugin.getName() + " (" + ( enabled ? "enabled" : "disabled" ) + ")."; }
/** * Load and instantiate the main class of the plugin specified. * * @param plugin The plugin to load the main class for. * @return The instantiated class * @throws KettlePluginException In case there was a loading problem. */ public Object loadClass( PluginInterface plugin ) throws KettlePluginException { return loadClass( plugin, plugin.getMainType() ); }
@Override public void pluginAdded( Object serviceObject ) { PluginInterface left = (PluginInterface) serviceObject; PluginInterface right = registry.findPluginWithId( typeToTrack, left.getIds()[0] ); mergePlugin( left, right ); }
private StepMetaInterface getNewMeta() throws KettleException { PluginRegistry pluginRegistry = PluginRegistry.getInstance(); String id = pluginRegistry.getPluginId( StepPluginType.class, this ); PluginInterface plugin = pluginRegistry.getPlugin( StepPluginType.class, id ); return (StepMetaInterface) pluginRegistry.loadClass( plugin ); } }
/** * Gets the plug-in type description * * @return the plug-in type description */ public String getTypeDesc() { PluginInterface plugin = PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, configId ); return plugin.getDescription(); }
public void fillOptionsAndCodesByPlugins( List<PluginInterface> plugins ) { int pluginIndex = 0; for ( PluginInterface plugin : plugins ) { options[ StepPartitioningMeta.methodDescriptions.length + pluginIndex ] = plugin.getDescription(); codes[ StepPartitioningMeta.methodCodes.length + pluginIndex ] = plugin.getIds()[ 0 ]; pluginIndex++; } }
public PluginInterface findPluginWithId( Class<? extends PluginTypeInterface> pluginType, String pluginId, boolean waitForPluginToBeAvailable ) { PluginInterface pluginInterface = findPluginWithId( pluginType, pluginId ); return waitForPluginToBeAvailable && pluginInterface == null ? waitForPluginToBeAvailable( pluginType, pluginId, WAIT_FOR_PLUGIN_TO_BE_AVAILABLE_LIMIT ) : pluginInterface; }
/** * Find the plugin ID based on the name of the plugin * * @param pluginType the type of plugin * @param pluginId The name to look for * @return The plugin with the specified name or null if nothing was found. */ public PluginInterface findPluginWithId( Class<? extends PluginTypeInterface> pluginType, String pluginId ) { return getPlugin( pluginType, pluginId ); }
/** * Let's put in code here to search for the step plugins.. */ @Override public void searchPlugins() throws KettlePluginException { registerNatives(); registerPluginJars(); registerXmlPlugins(); }
public String extractDesc( Annotation annotation ) { String desc = pluginType.extractDesc( annotation ); packageName = extractI18nPackageName( annotation ); return BasePluginType.getTranslation( desc, packageName, altPackageName, target.getClass() ); }
private Class<?> loadClassParentFirst( String arg0, boolean arg1 ) throws ClassNotFoundException { try { return loadClassFromParent( arg0, arg1 ); } catch ( ClassNotFoundException | NoClassDefFoundError e ) { // ignore } return loadClassFromThisLoader( arg0, arg1 ); }
/** * Keep track of new Fragments, keep note of the method signature's order * @param plugin The plugin to be merged * @param fragment The plugin fragment to merge */ @Override void mergePlugin( PluginInterface plugin, PluginInterface fragment ) { if ( plugin != null ) { plugin.merge( fragment ); } } } );
public static JobEntryDialogFragmentType getInstance() { if ( jobEntryDialogFragmentType == null ) { jobEntryDialogFragmentType = new JobEntryDialogFragmentType(); } return jobEntryDialogFragmentType; }
public static LifecyclePluginType getInstance() { if ( pluginType == null ) { pluginType = new LifecyclePluginType(); } return pluginType; }
@Override protected String extractClassLoaderGroup( Annotation annotation ) { return ( (DatabaseMetaPlugin) annotation ).classLoaderGroup(); } }
public static ImportRulePluginType getInstance() { if ( pluginType == null ) { pluginType = new ImportRulePluginType(); } return pluginType; }
@Override public void pluginChanged( Object serviceObject ) { pluginAdded( serviceObject ); } }
public static JobEntryPluginType getInstance() { if ( pluginType == null ) { pluginType = new JobEntryPluginType(); } return pluginType; }
public static CartePluginType getInstance() { if ( cartePluginType == null ) { cartePluginType = new CartePluginType(); } return cartePluginType; }
/** * Keep track of new Fragments, keep note of the method signature's order * @param fragment The plugin fragment to merge * @param plugin The plugin to be merged */ @Override void mergePlugin( PluginInterface fragment, PluginInterface plugin ) { if ( plugin != null ) { plugin.merge( fragment ); } } } );