use of org.pentaho.di.core.logging.LogTablePluginInterface in project pentaho-kettle by pentaho.
the class JobDialog method getLogTableUserInterface.
private LogTableUserInterface getLogTableUserInterface(LogTableInterface logTable, JobMeta jobMeta, ModifyListener lsMod) {
if (!(logTable instanceof LogTablePluginInterface)) {
return null;
}
LogTablePluginInterface pluginInterface = (LogTablePluginInterface) logTable;
String uiClassName = pluginInterface.getLogTablePluginUIClassname();
Class<?> uiClass;
Class<?>[] paramClasses = new Class<?>[] { JobMeta.class, ModifyListener.class, JobDialog.class };
Object[] paramArgs = new Object[] { jobMeta, lsMod, this };
Constructor<?> uiConstructor;
try {
uiClass = pluginInterface.getClass().getClassLoader().loadClass(uiClassName);
uiConstructor = uiClass.getConstructor(paramClasses);
return (LogTableUserInterface) uiConstructor.newInstance(paramArgs);
} catch (Exception e) {
new ErrorDialog(shell, "Error", "Unable to load UI interface class: " + uiClassName, e);
return null;
}
}
use of org.pentaho.di.core.logging.LogTablePluginInterface in project pentaho-kettle by pentaho.
the class JobMeta method clear.
/**
* Clears or reinitializes many of the JobMeta properties.
*/
@Override
public void clear() {
jobcopies = new ArrayList<JobEntryCopy>();
jobhops = new ArrayList<JobHopMeta>();
jobLogTable = JobLogTable.getDefault(this, this);
jobEntryLogTable = JobEntryLogTable.getDefault(this, this);
extraLogTables = new ArrayList<LogTableInterface>();
List<PluginInterface> plugins = PluginRegistry.getInstance().getPlugins(LogTablePluginType.class);
for (PluginInterface plugin : plugins) {
try {
LogTablePluginInterface logTablePluginInterface = (LogTablePluginInterface) PluginRegistry.getInstance().loadClass(plugin);
if (logTablePluginInterface.getType() == TableType.JOB) {
logTablePluginInterface.setContext(this, this);
extraLogTables.add(logTablePluginInterface);
}
} catch (Exception e) {
LogChannel.GENERAL.logError("Error loading log table plugin with ID " + plugin.getIds()[0], e);
}
}
arguments = null;
super.clear();
loopCache = new HashMap<String, Boolean>();
addDefaults();
jobStatus = -1;
jobVersion = null;
// setInternalKettleVariables(); Don't clear the internal variables for
// ad-hoc jobs, it's ruins the previews
// etc.
log = LogChannel.GENERAL;
}
Aggregations