SolarisWatchKey
Alan Bateman
Alan.Bateman at oracle.com
Mon Jun 25 02:00:19 PDT 2012
On 24/06/2012 14:42, Michael Hall wrote:
> As I think was mentioned previously I am trying to implement some WatchService code.
> I am for now sort picking SolarisWatchService to model how I am framing my code.
> Something was causing me a little trouble and I thought I'd verify it is intended and isn't at least a little confusing in the Solaris implementation.
> My source might be non-current and this already changed, my apologies if that is the case.
>
> AbstractWatchKey has the field
>
> // pending events
> private List<WatchEvent<?>> events;
>
> I can't test exactly this having no Solaris access but I believe this means for SolarisWatchKey which doesn't override pollEvents that this AbstractWatchKey method will return the List field.
It might be better to rename this field to pendingEvents to make it
clearer. The methods that access it (pollEvents, signalEvent and reset)
are final.
Note that the Solaris 11 WatchService implementation is significantly
more complicated that the implementations for the other platforms so you
might be better looking at the other implementations first to get a feel
for how they work.
-Alan.
More information about the nio-dev
mailing list