/** * 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 avalaible implementations of {@link GridFormatFactorySpi} which have registered * using the services mechanism, and that have the appropriate libraries on the classpath. * * @return An unmodifiable {@link Set} of all discovered datastores which have registered * factories, and whose available method returns true. */ public static synchronized Set<GridFormatFactorySpi> getAvailableFormats() { // get all GridFormatFactorySpi implementations scanForPlugins(); return getServiceRegistry() .getFactories(GridFormatFactorySpi.class, true) .filter(GridFormatFactorySpi::isAvailable) .collect(toUnmodifiableSet()); }
/** * 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 avalaible implementations of {@link GridFormatFactorySpi} which * have registered using the services mechanism, and that have the * appropriate libraries on the classpath. * * @return An unmodifiable {@link Set} of all discovered datastores which * have registered factories, and whose available method returns * true. */ public static synchronized Set<GridFormatFactorySpi> getAvailableFormats() { // get all GridFormatFactorySpi implementations scanForPlugins(); final Iterator<GridFormatFactorySpi> it = getServiceRegistry(). getServiceProviders(GridFormatFactorySpi.class, true); final Set<GridFormatFactorySpi> formats= new HashSet<GridFormatFactorySpi>(); while (it.hasNext()) { final GridFormatFactorySpi spi = (GridFormatFactorySpi) it.next(); if (spi.isAvailable()) formats.add(spi); } return Collections.unmodifiableSet(formats); }
/** * Finds all avalaible implementations of {@link GridFormatFactorySpi} which * have registered using the services mechanism, and that have the * appropriate libraries on the classpath. * * @return An unmodifiable {@link Set} of all discovered datastores which * have registered factories, and whose available method returns * true. */ public static synchronized Set getAvailableFormats() { // get all GridFormatFactorySpi implementations scanForPlugins(); Iterator it = getServiceRegistry(). getServiceProviders(GridFormatFactorySpi.class, true); final Set formats= new HashSet(5); GridFormatFactorySpi spi; while (it.hasNext()) { spi = (GridFormatFactorySpi) it.next(); if (spi.isAvailable()) formats.add(spi); } return Collections.unmodifiableSet(formats); }