/** * Finds all implementations of {@link ExternalGraphicFactory} which have registered using the * services mechanism. * * @return An iterator over all registered ExternalGraphicFactory */ public static synchronized Iterator<ExternalGraphicFactory> getExternalGraphicFactories() { return getExternalGraphicFactories(null); }
/** * Finds all implementations of {@link ExternalGraphicFactory} which have registered using the * services mechanism. * * @param hints An optional map of hints for factory configfuration, or {@code null} if none. * @return An iterator over all registered ExternalGraphicFactory */ public static synchronized Iterator<ExternalGraphicFactory> getExternalGraphicFactories( Hints hints) { return getServiceRegistry() .getFactories(ExternalGraphicFactory.class, null, hints) .iterator(); }
Iterator<MarkFactory> it = DynamicSymbolFactoryFinder.getMarkFactories(); while (it.hasNext()) { MarkFactory factory = it.next();
public void testLookupMarkFactories() { List<MarkFactory> result = loadIterator(DynamicSymbolFactoryFinder.getMarkFactories()); assertTrue(result.size() >= 2); assertContainsClassInstance(result, WellKnownMarkFactory.class); assertContainsClassInstance(result, TTFMarkFactory.class); }
public void testLookupExternalGraphicFactories() { List<ExternalGraphicFactory> result = loadIterator(DynamicSymbolFactoryFinder.getExternalGraphicFactories()); assertTrue(result.size() >= 1); assertContainsClassInstance(result, ImageGraphicFactory.class); }
.getMarkFactories(); while (it.hasNext()) { MarkFactory factory = it.next();
/** * Finds all implementations of {@link MarkFactory} which have registered using the services * mechanism. * * @return An iterator over all discovered datastores which have registered factories, and whose * available method returns true. */ public static synchronized Iterator<MarkFactory> getMarkFactories() { return getServiceRegistry().getFactories(MarkFactory.class, null, null).iterator(); }
DynamicSymbolFactoryFinder.getExternalGraphicFactories(new Hints(renderingHints)); while (it.hasNext()) { ExternalGraphicFactory egf = it.next();
/** * 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(); } }
DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while (it.hasNext() && icon == null) { try {
/** * Finds all implementations of {@link MarkFactory} which have registered * using the services mechanism. * * @return An iterator over all discovered datastores which have registered * factories, and whose available method returns true. */ public static synchronized Iterator<MarkFactory> getMarkFactories() { return getServiceRegistry().getServiceProviders(MarkFactory.class, null, null); }
public void onReset() { // kill the image caches Iterator<ExternalGraphicFactory> it = DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while (it.hasNext()) { ExternalGraphicFactory egf = it.next(); if (egf instanceof GraphicCache) { ((GraphicCache) egf).clearCache(); } } // reloads the font cache reloadFontCache(); // reset WMS Animator Executor Service resetAnimatorExecutorService(); }
/** * Finds all implementations of {@link ExternalGraphicFactory} which have * registered using the services mechanism. * * @return An iterator over all discovered datastores which have registered * factories, and whose available method returns true. */ public static synchronized Iterator<ExternalGraphicFactory> getExternalGraphicFactories() { return getServiceRegistry().getServiceProviders(ExternalGraphicFactory.class, null, null); }
private static @Nullable Icon getIcon(ExternalGraphic eg, @Nullable Feature f) { // Get the Icon for an external image symbol Icon i = eg.getInlineContent(); if(i==null) { Expression location; try { location = ExpressionExtractor.extractCqlExpressions(eg.getLocation().toString()); Iterator<ExternalGraphicFactory> it = DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while(i==null && it.hasNext()) { try { ExternalGraphicFactory fact = it.next(); i = fact.getIcon((Feature) null, location, eg.getFormat(), -1); } catch(Exception e) { LOGGER.log(Level.FINE, "Error occurred evaluating external graphic", e); } } } catch (MalformedURLException e1) { LOGGER.log(Level.FINER, e1.getMessage(), e1); } } return i; }
/** * 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(); } }
Iterator<ExternalGraphicFactory> it = DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while(it.hasNext()) { try {
DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while (it.hasNext()) { try {
DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while (it.hasNext()) { try {
.getExternalGraphicFactories(); while (it.hasNext()) { ExternalGraphicFactory egf = it.next();
@Test public void testWMSLifecycleHandlerGraphicCacheReset() throws Exception { Iterator<ExternalGraphicFactory> it = DynamicSymbolFactoryFinder.getExternalGraphicFactories(); Map<URL, BufferedImage> imageCache = null; while (it.hasNext()) { ExternalGraphicFactory egf = it.next(); if (egf instanceof ImageGraphicFactory) { Field cache = egf.getClass().getDeclaredField("imageCache"); cache.setAccessible(true); imageCache = (Map) cache.get(egf); URL u = new URL("http://boundless.org"); BufferedImage b = new BufferedImage(6, 6, 8); imageCache.put(u, b); } } assertNotEquals(0, imageCache.size()); getGeoServer().reload(); assertEquals(0, imageCache.size()); } }