com.github.dreamhead.moco.runner.watcher.DefaultWatcher Maven / Gradle / Ivy
package com.github.dreamhead.moco.runner.watcher;
import java.io.File;
import java.util.function.Function;
public final class DefaultWatcher implements Watcher {
private final WatcherService service;
private final Function listener;
private final File file;
public DefaultWatcher(final WatcherService service, final Function listener, final File file) {
this.service = service;
this.listener = listener;
this.file = file;
}
@Override
public void start() {
service.register(file, listener);
}
@Override
public void stop() {
service.unregister(file);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy