Search in sources :

Example 1 with LogTablePluginInterface

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;
    }
}
Also used : JobMeta(org.pentaho.di.job.JobMeta) ModifyListener(org.eclipse.swt.events.ModifyListener) LogTablePluginInterface(org.pentaho.di.core.logging.LogTablePluginInterface) ErrorDialog(org.pentaho.di.ui.core.dialog.ErrorDialog) DuplicateParamException(org.pentaho.di.core.parameters.DuplicateParamException) UnknownParamException(org.pentaho.di.core.parameters.UnknownParamException) KettleException(org.pentaho.di.core.exception.KettleException) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException)

Example 2 with LogTablePluginInterface

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;
}
Also used : LogTablePluginInterface(org.pentaho.di.core.logging.LogTablePluginInterface) LogTablePluginInterface(org.pentaho.di.core.logging.LogTablePluginInterface) PluginInterface(org.pentaho.di.core.plugins.PluginInterface) KettleXMLException(org.pentaho.di.core.exception.KettleXMLException) KettleFileException(org.pentaho.di.core.exception.KettleFileException) UnknownParamException(org.pentaho.di.core.parameters.UnknownParamException) LookupReferencesException(org.pentaho.di.core.exception.LookupReferencesException) FileSystemException(org.apache.commons.vfs2.FileSystemException) KettleException(org.pentaho.di.core.exception.KettleException) KettleDatabaseException(org.pentaho.di.core.exception.KettleDatabaseException) IdNotFoundException(org.pentaho.di.core.exception.IdNotFoundException) LogTableInterface(org.pentaho.di.core.logging.LogTableInterface) JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)2 LogTablePluginInterface (org.pentaho.di.core.logging.LogTablePluginInterface)2 UnknownParamException (org.pentaho.di.core.parameters.UnknownParamException)2 FileSystemException (org.apache.commons.vfs2.FileSystemException)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 IdNotFoundException (org.pentaho.di.core.exception.IdNotFoundException)1 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)1 KettleFileException (org.pentaho.di.core.exception.KettleFileException)1 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)1 LookupReferencesException (org.pentaho.di.core.exception.LookupReferencesException)1 LogTableInterface (org.pentaho.di.core.logging.LogTableInterface)1 DuplicateParamException (org.pentaho.di.core.parameters.DuplicateParamException)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1 JobMeta (org.pentaho.di.job.JobMeta)1 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)1 KettleRepositoryLostException (org.pentaho.di.repository.KettleRepositoryLostException)1 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)1