use of org.apache.hop.pipeline.engine.IPipelineEngine in project hop by apache.
the class PipelineRunConfigurationMetadataObjectFactory method createObject.
@Override
public Object createObject(String id, Object parentObject) throws HopException {
PluginRegistry registry = PluginRegistry.getInstance();
IPlugin plugin = registry.findPluginWithId(PipelineEnginePluginType.class, id);
if (plugin == null) {
throw new HopException("Unable to find the plugin in the context of a pipeline engine plugin for id: " + id);
}
try {
// We don't return the engine but the corresponding engine configuration
//
IPipelineEngine engine = registry.loadClass(plugin, IPipelineEngine.class);
IPipelineEngineRunConfiguration engineRunConfiguration = engine.createDefaultPipelineEngineRunConfiguration();
engineRunConfiguration.setEnginePluginId(plugin.getIds()[0]);
engineRunConfiguration.setEnginePluginName(plugin.getName());
if (parentObject != null && (parentObject instanceof IVariables)) {
engineRunConfiguration.initializeFrom((IVariables) parentObject);
}
return engineRunConfiguration;
} catch (HopPluginException e) {
throw new HopException("Unable to load the pipeline engine plugin class with plugin id: " + id, e);
}
}
Aggregations