add suspend/resume to path event manager

This commit is contained in:
Jörg Prante 2024-01-05 16:53:56 +01:00
parent d191369efe
commit 48bbb2e455
2 changed files with 4 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package org.xbib.event.io.path;
import org.xbib.event.Event; import org.xbib.event.Event;
import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;
public interface PathEvent extends Event { public interface PathEvent extends Event {
@ -18,8 +19,8 @@ public interface PathEvent extends Event {
String getSuffix(); String getSuffix();
void success(); void success() throws IOException;
void fail(); void fail() throws IOException;
} }

View file

@ -172,7 +172,7 @@ public class PathEventService implements Callable<Integer>, Closeable {
} }
} }
private void failEvent(String key, Path file) { private void failEvent(String key, Path file) throws IOException {
PathEvent event = toEvent(key, file); PathEvent event = toEvent(key, file);
if (event != null) { if (event != null) {
logger.log(Level.WARNING, "queue " + name + " suspended, event short-circuited to fail"); logger.log(Level.WARNING, "queue " + name + " suspended, event short-circuited to fail");