...
- StepLoader.findStepPluginWithID(id) --> PluginRegistry.findPluginWithId(StepPluginType.getInstance()class, id)
- StepPlugin --> PluginInterface
- StepLoader.getStepClass(StepPlugin) --> (StepMetaInterface)PluginRegistry.loadClass(PluginInterface, PluginClassType.MainClassType)
- StepLoader.getStepPluginID(StepMetaInterface) --> PluginRegistry.getPluginId(StepPluginType.getInstance().class, StepMetaInterface)
- init() --> taken over by PluginRegistry.init() and StepPluginType.searchPlugins()
- getPluginPackages() --> is now available as getPluginPackages(PluginTypeInterface) returning a list of package names.
- getPluginInformation() --> getPluginInformation(PluginTypeInterface) returning a RowBuffer object
...
- JobEntryLoader.findJobEntriesWithDescription(String) --> PluginRegistry.findPluginWithName(StepPluginType..getInstance()class, description)
- JobPlugin (also with a wrong name!) --> PluginInterface
- JobEntryLoader.getStepClass(StepPlugin) --> (JobEntryInterface)PluginRegistry.loadClass(PluginInterface, PluginClassType.MainClassType)
- JobEntryLoader.getJobEntryPluginID(JobEntryInterface) --> PluginRegistry.getPluginId(JobEntryPluginType.getInstance(), JobEntryInterface)
- init(): taken over by PluginRegistry.init() and JobEntryPluginType.searchPlugins()
- getPluginPackages(): is now available as getPluginPackages(PluginTypeInterface) returning a list of package names.
- getPluginInformation(): getPluginInformation(PluginTypeInterface) returning a RowBuffer object
The JobPlugin class and the PluginInterface are quite similar, see the StepLoader paragraph above for more information.
DatabaseMeta
Since the creation of DatabaseMeta is now handled by the PluginRegistry as well, we can say a few words about the migration of your code.
Here are a few of the methods that are now missing from DatabaseMeta:
- getDatabaseTypeDescLong() --> You need to look up the PluginInterface for this database in the plugin registry with the pluginId.
PluginInterface plugin = registry.getPlugin(DatabasePluginType.class, pluginId);
With this you can determine the name (previous long description) - getDatabaseTypeDesc() --> This is in fact the plugin ID of the DatabaseMeta object.
Examples from the field
Job entry example
Code Block |
---|
JobPlugin plugin = JobEntryLoader.getInstance().findJobPluginWithID(typeId);
|
becomes:
Code Block |
---|
PluginInterface plugin = PluginRegistry.getInstance().getPlugin(JobEntryPluginType..class, typeId);
|
Step plugin example
Code Block |
---|
stepMetaInterface = StepLoader.getInstance().getStepClass(sp);
|
becomes
Code Block |
---|
stepMetaInterface = (StepMetaInterface)PluginRegistry.getInstance().loadClass(sp); |
Pentaho Examples
Code Block |
---|
StepLoader steploader = StepLoader.getInstance();
String fromstepid = steploader.getStepPluginID(tii);
|
becomes
Code Block |
---|
PluginRegistry registry = PluginRegistry.getInstance();
String fromstepid = registry.getPluginId(tii);
|
Code Block |
---|
repository = (Repository) RepositoryLoader.createRepository(repositoryMeta);
|
becomes
Code Block |
---|
repository = (Repository)PluginRegistry.getInstance().loadClass(RepositoryPluginType..class, repositoryMeta.getId(), PluginClassType.MainClassType);
repository.init(repositoryMeta);
|