Search in sources :

Example 1 with DataTransferState

use of org.jkiss.dbeaver.tools.transfer.DataTransferState in project dbeaver by serge-rider.

the class DTTaskHandlerTransfer method executeTask.

@Override
public void executeTask(@NotNull DBRRunnableContext runnableContext, @NotNull DBTTask task, @NotNull Locale locale, @NotNull Log log, @NotNull PrintStream logStream, @NotNull DBTTaskExecutionListener listener) throws DBException {
    DataTransferSettings[] settings = new DataTransferSettings[1];
    try {
        runnableContext.run(true, true, monitor -> {
            settings[0] = new DataTransferSettings(monitor, task, log, Collections.emptyMap(), new DataTransferState());
        });
    } catch (InvocationTargetException e) {
        throw new DBException("Error loading task settings", e.getTargetException());
    } catch (InterruptedException e) {
        return;
    }
    executeWithSettings(runnableContext, task, locale, log, listener, settings[0]);
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DBException(org.jkiss.dbeaver.DBException) DataTransferState(org.jkiss.dbeaver.tools.transfer.DataTransferState) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 2 with DataTransferState

use of org.jkiss.dbeaver.tools.transfer.DataTransferState in project dbeaver by dbeaver.

the class DTTaskHandlerTransfer method executeTask.

@Override
public void executeTask(@NotNull DBRRunnableContext runnableContext, @NotNull DBTTask task, @NotNull Locale locale, @NotNull Log log, @NotNull PrintStream logStream, @NotNull DBTTaskExecutionListener listener) throws DBException {
    DataTransferSettings[] settings = new DataTransferSettings[1];
    try {
        runnableContext.run(true, true, monitor -> {
            settings[0] = new DataTransferSettings(monitor, task, log, Collections.emptyMap(), new DataTransferState());
        });
    } catch (InvocationTargetException e) {
        throw new DBException("Error loading task settings", e.getTargetException());
    } catch (InterruptedException e) {
        return;
    }
    executeWithSettings(runnableContext, task, locale, log, listener, settings[0]);
}
Also used : DataTransferSettings(org.jkiss.dbeaver.tools.transfer.DataTransferSettings) DBException(org.jkiss.dbeaver.DBException) DataTransferState(org.jkiss.dbeaver.tools.transfer.DataTransferState) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)2 DBException (org.jkiss.dbeaver.DBException)2 DataTransferSettings (org.jkiss.dbeaver.tools.transfer.DataTransferSettings)2 DataTransferState (org.jkiss.dbeaver.tools.transfer.DataTransferState)2