From 48bbb2e455899d8ed0f1444cc04eaf53a011b0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Prante?= Date: Fri, 5 Jan 2024 16:53:56 +0100 Subject: [PATCH] add suspend/resume to path event manager --- src/main/java/org/xbib/event/io/path/PathEvent.java | 5 +++-- src/main/java/org/xbib/event/io/path/PathEventService.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/xbib/event/io/path/PathEvent.java b/src/main/java/org/xbib/event/io/path/PathEvent.java index dfb6f28..b2597c9 100644 --- a/src/main/java/org/xbib/event/io/path/PathEvent.java +++ b/src/main/java/org/xbib/event/io/path/PathEvent.java @@ -2,6 +2,7 @@ package org.xbib.event.io.path; import org.xbib.event.Event; +import java.io.IOException; import java.nio.file.Path; public interface PathEvent extends Event { @@ -18,8 +19,8 @@ public interface PathEvent extends Event { String getSuffix(); - void success(); + void success() throws IOException; - void fail(); + void fail() throws IOException; } diff --git a/src/main/java/org/xbib/event/io/path/PathEventService.java b/src/main/java/org/xbib/event/io/path/PathEventService.java index ad0cd70..9a80ec9 100644 --- a/src/main/java/org/xbib/event/io/path/PathEventService.java +++ b/src/main/java/org/xbib/event/io/path/PathEventService.java @@ -172,7 +172,7 @@ public class PathEventService implements Callable, Closeable { } } - private void failEvent(String key, Path file) { + private void failEvent(String key, Path file) throws IOException { PathEvent event = toEvent(key, file); if (event != null) { logger.log(Level.WARNING, "queue " + name + " suspended, event short-circuited to fail");