/** * Finds all implementations of UnWrapper which have registered using the services mechanism, * and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered UnWrapper which have registered factories */ public static synchronized Iterator<UnWrapper> getUnWrappers() { return getServiceRegistry().getFactories(UnWrapper.class, null, null).iterator(); }
/** * Scans for factory plug-ins on the application class path. This method is needed because the * application class path can theoretically change, or additional plug-ins may become available. * Rather than re-scanning the classpath on every invocation of the API, the class path is * scanned automatically only on the first invocation. Clients can call this method to prompt a * re-scan. Thus this method need only be invoked by sophisticated applications which * dynamically make new plug-ins available at runtime. */ public static synchronized void scanForPlugins() { getServiceRegistry().scanForPlugins(); } }
/** * Finds all implementations of DataStoreFactory which have registered using the services * mechanism, and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered DataStores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator<DataSourceFactorySpi> getAvailableDataSources() { Stream<DataSourceFactorySpi> factories = getServiceRegistry().getFactories(DataSourceFactorySpi.class, null, null); // results are collected into HashSet (even though iterator is returned) // to find broken implementations early rather than later caller code Set<DataSourceFactorySpi> availableDS = factories .filter(dsFactory -> dsFactory.isAvailable()) .collect(Collectors.toCollection(HashSet::new)); return availableDS.iterator(); }
/** * Finds all implemtaions of DataStoreFactory which have registered using the services * mechanism, and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered datastores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator getUnWrappers() { Set availableDS = new HashSet(); return getServiceRegistry().getServiceProviders(UnWrapper.class); }
/** * Finds all implemtaions of DataStoreFactory which have registered using the services * mechanism, and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered datastores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator getUnWrappers() { Set availableDS = new HashSet(); return getServiceRegistry().getServiceProviders(UnWrapper.class, null, null); }
/** * Scans for factory plug-ins on the application class path. This method is needed because the * application class path can theoretically change, or additional plug-ins may become available. * Rather than re-scanning the classpath on every invocation of the API, the class path is * scanned automatically only on the first invocation. Clients can call this method to prompt a * re-scan. Thus this method need only be invoked by sophisticated applications which * dynamically make new plug-ins available at runtime. */ public static synchronized void scanForPlugins() { getServiceRegistry().scanForPlugins(); } }
/** * Scans for factory plug-ins on the application class path. This method is needed because the * application class path can theoretically change, or additional plug-ins may become available. * Rather than re-scanning the classpath on every invocation of the API, the class path is * scanned automatically only on the first invocation. Clients can call this method to prompt a * re-scan. Thus this method need only be invoked by sophisticated applications which * dynamically make new plug-ins available at runtime. */ public static synchronized void scanForPlugins() { getServiceRegistry().scanForPlugins(); } }
/** * Finds all implemtaions of DataStoreFactory which have registered using the services * mechanism, and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered datastores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator getAvailableDataSources() { Set availableDS = new HashSet(); Iterator it = getServiceRegistry().getServiceProviders(DataSourceFactorySpi.class); DataSourceFactorySpi dsFactory; while (it.hasNext()) { dsFactory = (DataSourceFactorySpi) it.next(); if (dsFactory.isAvailable()) { availableDS.add(dsFactory); } } return availableDS.iterator(); }
/** * Finds all implemtaions of DataStoreFactory which have registered using the services * mechanism, and that have the appropriate libraries on the classpath. * * @return An iterator over all discovered datastores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator getAvailableDataSources() { Set availableDS = new HashSet(); Iterator it = getServiceRegistry().getServiceProviders(DataSourceFactorySpi.class, null, null); DataSourceFactorySpi dsFactory; while (it.hasNext()) { dsFactory = (DataSourceFactorySpi) it.next(); if (dsFactory.isAvailable()) { availableDS.add(dsFactory); } } return availableDS.iterator(); }