started another importer overhaul

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-01-01 16:11:30 +01:00
parent d9e5475962
commit 3c7313fc01
9 changed files with 527 additions and 257 deletions
@@ -10,7 +10,6 @@ import de.srsoftware.cal.api.Importer;
import de.srsoftware.cal.db.Database;
import de.srsoftware.tools.plugin.ClassListener;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.*;
@@ -282,10 +281,10 @@ public class AutoImporter implements Runnable, ClassListener {
if (Importer.class.isAssignableFrom(aClass)) try {
var instance = aClass.getDeclaredConstructor().newInstance();
importers.add((Importer) instance);
LOG.log(INFO,"Added {0} to the list of importers. Will be used soon…",instance);
lastImport = null;
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
throw new RuntimeException(e);
LOG.log(INFO,"Added {0} to the list of importers. Will be used soon…",instance);
} catch (Exception e) {
LOG.log(WARNING,"Failed to add importer: {0}",aClass.getSimpleName(),e);
}
}