code: public static SelectorProvider provider() {
          synchronized (lock) {
              if (provider != null)
                  return provider;
              /*
              return AccessController.doPrivileged(
                  new PrivilegedAction<SelectorProvider>() {
                      public SelectorProvider run() {
                              if (loadProviderFromProperty())
                                  return provider;
                              if (loadProviderAsService())
                                  return provider;
                              provider = sun.nio.ch.DefaultSelectorProvider.create();
                              return provider;
                          }
                      });
               */
              if (loadProviderFromProperty()) {
                  return provider;
              }
              if (loadProviderAsService()) {
                  return provider;
              }
              provider = sun.nio.ch.DefaultSelectorProvider.create();
              return provider;
          }
      }
docs: Returns the system-wide default selector provider for this invocation of
  the Java virtual machine.
  
  <p> The first invocation of this method locates the default provider
  object as follows: </p>
  
  <ol>
  
  <li><p> If the system property
  <tt>java.nio.channels.spi.SelectorProvider</tt> is defined then it is
  taken to be the fully-qualified name of a concrete provider class.
  The class is loaded and instantiated; if this process fails then an
  unspecified error is thrown.  </p></li>
  
  <li><p> If a provider class has been installed in a jar file that is
  visible to the system class loader, and that jar file contains a
  provider-configuration file named
  <tt>java.nio.channels.spi.SelectorProvider</tt> in the resource
  directory <tt>META-INF/services</tt>, then the first class name
  specified in that file is taken.  The class is loaded and
  instantiated; if this process fails then an unspecified error is
  thrown.  </p></li>
  
  <li><p> Finally, if no provider has been specified by any of the above
  means then the system-default provider class is instantiated and the
  result is returned.  </p></li>
  
  </ol>
  
  <p> Subsequent invocations of this method return the provider that was
  returned by the first invocation.  </p>
  
  @return  The system-wide default selector provider