Adding analyzers from existing PDI plug-ins (non-OSGi)
import org.pentaho.di.core.annotations.LifecyclePlugin;
import org.pentaho.di.core.lifecycle.LifeEventHandler;
import org.pentaho.di.core.lifecycle.LifecycleListener;
import org.pentaho.platform.engine.core.system.PentahoSystem;
@LifecyclePlugin( id = "CsvFileInputPlugin", name = "CsvFileInputPlugin" )
public class CsvFileInputLifecycleListener implements LifecycleListener {
CsvFileInputStepAnalyzer analyzer;
CsvFileInputExternalResourceConsumer consumer;
@Override public void onStart( LifeEventHandler lifeEventHandler ) {
// instantiate a new analyzer
analyzer = new CsvFileInputStepAnalyzer();
// construct the external resource consumer for the files that it reads from
consumer = new CsvFileInputExternalResourceConsumer();
analyzer.setExternalResourceConsumer( consumer );
// register the analyzer with PentahoSystem. this also adds it to the service reference list that contains ALL IStepAnalyzers registered
PentahoSystem.registerObject( analyzer );
// register the consumer with PentahoSystem. this also adds it to the service reference list that contains ALL IStepExternalResourceConsumers registered
PentahoSystem.registerObject( consumer );
}
@Override public void onExit( LifeEventHandler lifeEventHandler ) {
}
}Last updated
Was this helpful?

