Hardcoded default providers for asynchronous channel and file system

Alan Bateman Alan.Bateman at oracle.com
Tue Nov 8 02:07:52 PST 2011


On 08/11/2011 10:00, Rémi Forax wrote:
>
> Hi Alan, Hi Jonathan,
> I've already written a program that changes the default selector provider
> by changing the property before trying to access the default file system.
>
> I have no problem with the fact that the default provider class is 
> hardcoded
> at build time but the property should still exist,
> otherwise it will break my code.
>
> If you're curious, here is why I change the default provider:
> http://weblogs.java.net/blog/forax/archive/2011/10/01/asyncswing
I haven't looked at the patch yet (might be a few days) but the system 
property to override the default provider shouldn't be impacted. It's 
really only 
sun.nio.ch.{DefaultSelectorProvider,DefaultAsynchronousChannelProvider} 
and sun.nio.fs.DefaultFileSystemProvider that need to be touched. This 
is why get used if the default provider isn't specified via a system 
property (or the other specified lookup mechanism). A simply rename or 
sed replacement in the build should do it.

-Alan.


More information about the nio-dev mailing list