Intriducing NIO functionality to Java 1.4
Michael Hall
mik3hall at gmail.com
Thu Mar 3 09:41:41 UTC 2016
> On Mar 2, 2016, at 11:34 AM, Dehan De Croos <dehandecroos at gmail.com> wrote:
>
> Hi Team,
> I have a requirement to introduce a directory listening functionality - [,WatchService API ] to JAVA 1.4. Is this possible?
>
> best regards,
> Dehan de Croos
You might check to see if any 3rd party code does what you already want. Polling is discussed and should be doable pure java at 1.4. The nio implementation of a watchservice for OS X is currently still a polling one as far as I know. No one seems to claim that is great, but...
I think this...
https://stackoverflow.com/questions/494869/file-changed-listener-in-java <https://stackoverflow.com/questions/494869/file-changed-listener-in-java>
lists some possibilities.
If you go native and get a kqueue watch service working please let the list know. I tried one for OS X that I couldn’t get working right. It seemed to deadlock on the ‘many files’ nio test case where kqueue would stop pumping events when the java code waited for more. I could get back to it sometime but have no immediate plans to.
Michael Hall
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160303/e0cf1525/attachment-0001.html>
More information about the nio-dev
mailing list