You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Jochen Wiedmann (JIRA)" <ji...@apache.org> on 2015/03/05 20:15:38 UTC
[jira] [Commented] (IO-470) Using WatchService in Tailer instead of
polling
[ https://issues.apache.org/jira/browse/IO-470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349305#comment-14349305 ]
Jochen Wiedmann commented on IO-470:
------------------------------------
In Apache XmlRpc, we had several situations, that we did resolve like the following:
public class Tailer implements ITailer {
private final ITailer tailer = newTailer();
private static final ITailer newTailer() {
try {
return new Jdk7Tailer(); // Works, if running under Java 7
} catch (Throwable t) {
return new Jdk6Tailer();
}
}
@Override
public void someITailerMethod() {
tailer.someITailerMethod();
}
};
This works gracefully with Java 6 and Java 7.
> Using WatchService in Tailer instead of polling
> -----------------------------------------------
>
> Key: IO-470
> URL: https://issues.apache.org/jira/browse/IO-470
> Project: Commons IO
> Issue Type: Improvement
> Components: Utilities
> Affects Versions: 2.4
> Reporter: Jeremiah Orr
> Labels: Java7, Tailer
> Fix For: 2.5
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Tailer would benefit from using Java 7's WatchService to detect file changes instead of polling at a set interval. Tailer could respond quicker to changes, and it would save the system from constant polling. This of course would mean that commons-io would require Java 7.
> I don't know what the future release plans are for commons-io; if there's an upcoming version that will require Java 7, I'll happily make this change myself.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)