private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
private static PreferencesFactory findPreferencesFactory() { // Try the system property first... PreferencesFactory result = ServiceLoader.loadFromSystemProperty(PreferencesFactory.class); if (result != null) { return result; } // Then use ServiceLoader for META-INF/services/... for (PreferencesFactory impl : ServiceLoader.load(PreferencesFactory.class)) { return impl; } // Finally return a default... return new FilePreferencesFactoryImpl(); }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }
/** * Gets a provider instance by executing the following steps when called for * the first time: * <ul> * <li> if the system property "java.nio.channels.spi.SelectorProvider" is * set, the value of this property is the class name of the provider * returned; </li> * <li>if there is a provider-configuration file named * "java.nio.channels.spi.SelectorProvider" in META-INF/services of a jar * file valid in the system class loader, the first class name is the * provider's class name; </li> * <li> otherwise, a system default provider will be returned.</li> * </ul> * * @return the provider. */ synchronized public static SelectorProvider provider() { if (provider == null) { provider = ServiceLoader.loadFromSystemProperty(SelectorProvider.class); if (provider == null) { provider = loadProviderByJar(); } if (provider == null) { provider = new SelectorProviderImpl(); } } return provider; }