Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W-16676258: Use WatchService for TracingConfigurationFileWatcher #13826

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
..
  • Loading branch information
lbarrios committed Sep 5, 2024
commit 1928dadff10d5b8ba5e8d0073157a76c7ebec257
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
package org.mule.runtime.tracer.common.watcher;

import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
Copy link
Contributor

@fsgonz fsgonz Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

order of static imports.
We follow this convention:
static imports
-> mule -> java -> other ones
import
-> mule classes -> java -> other ones.

import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
import static org.mule.runtime.tracer.exporter.config.api.OpenTelemetrySpanExporterConfigurationProperties.MULE_OPEN_TELEMETRY_EXPORTER_CONFIGURATION_WATCHER_DEFAULT_DELAY_PROPERTY;

Expand Down Expand Up @@ -38,7 +39,7 @@ public class TracingConfigurationFileWatcher extends Thread {
protected long delay = DEFAULT_DELAY;

public TracingConfigurationFileWatcher(String filename, Runnable doOnChange) {
super("FileSpanExporterConfigurationWatcher");
super("TracingConfigurationFileWatcher");
this.file = new File(filename);
this.doOnChange = doOnChange;

Expand Down Expand Up @@ -66,6 +67,7 @@ protected void checkAndConfigure() throws InterruptedException {
}
}
}

key.reset();
}

Expand Down