/** * 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); }
public void testLookupExternalGraphicFactories() { List<ExternalGraphicFactory> result = loadIterator(DynamicSymbolFactoryFinder.getExternalGraphicFactories()); assertTrue(result.size() >= 1); assertContainsClassInstance(result, ImageGraphicFactory.class); }
DynamicSymbolFactoryFinder.getExternalGraphicFactories(new Hints(renderingHints)); while (it.hasNext()) { ExternalGraphicFactory egf = it.next();
DynamicSymbolFactoryFinder.getExternalGraphicFactories(); while (it.hasNext() && icon == null) { try {
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(); }
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; }
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()); } }