Sending Email with Message = Hello Sending Push Notification with Message = Hello Sending Email with Message = Hello Friend Sending Email with Message = Have a Nice Day! Sending Push Notification with Message = Have a Nice Day! 2
// JDK11 版本的 ServiceLoader,与JDK8的版本略有差异 publicfinalclassServiceLoader<S> implementsIterable<S> { // The class or interface representing the service being loaded privatefinal Class<S> service;
// The class of the service type privatefinal String serviceName;
// The module layer used to locate providers; null when locating // providers using a class loader privatefinal ModuleLayer layer;
// The class loader used to locate, load, and instantiate providers; // null when locating provider using a module layer privatefinal ClassLoader loader;
// The access control context taken when the ServiceLoader is created privatefinal AccessControlContext acc;
// The lazy-lookup iterator for iterator operations private Iterator<Provider<S>> lookupIterator1; privatefinal List<S> instantiatedProviders = newArrayList<>();
// The lazy-lookup iterator for stream operations private Iterator<Provider<S>> lookupIterator2; privatefinal List<Provider<S>> loadedProviders = newArrayList<>(); privateboolean loadedAllProviders; // true when all providers loaded
// Incremented when reload is called privateint reloadCount;