SolarisWatchKey

Michael Hall mik3hall at gmail.com
Sun Jun 24 06:42:12 PDT 2012


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.

SolarisWatchKey (in SolarisWatchService.java) which extends AbstractWatchKey has the field

        // events (may be changed). set to null when watch key is invalid
        private volatile Set<? extends WatchEvent.Kind<?>> events;

Any references to events in the subclass will I believe reference this field. And if say it was decided to override the pollEvents method any references to events would now be to the subclass 's WatchEvent.Kind Set? Is there not some possibility this might cause someone else some confusion in the future having these different type fields have the same name?





More information about the nio-dev mailing list