Package com.twelvemonkeys.servlet.image
Class IIOProviderContextListener
- java.lang.Object
-
- com.twelvemonkeys.servlet.image.IIOProviderContextListener
-
- All Implemented Interfaces:
java.util.EventListener,javax.servlet.ServletContextListener
public final class IIOProviderContextListener extends java.lang.Object implements javax.servlet.ServletContextListenerTakes care of registering and de-registering local ImageIO plugins (service providers) for the servlet context.Registers all available plugins on
contextInitializedevent, usingImageIO.scanForPlugins(), to make sure they are available to the current servlet context. De-registers all plugins which have thecurrent thread's context class loaderas its class loader oncontextDestroyedevent, to avoid class/resource leak.- Version:
- $Id: IIOProviderContextListener.java,v 1.0 14.02.12 21:53 haraldk Exp$
- See Also:
ImageIO.scanForPlugins()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classIIOProviderContextListener.LocalFilter
-
Constructor Summary
Constructors Constructor Description IIOProviderContextListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextDestroyed(javax.servlet.ServletContextEvent event)voidcontextInitialized(javax.servlet.ServletContextEvent event)private static <T> voidderegisterLocalProvidersForCategory(javax.imageio.spi.IIORegistry registry, IIOProviderContextListener.LocalFilter localFilter, java.lang.Class<T> category, javax.servlet.ServletContext context)
-
-
-
Method Detail
-
contextInitialized
public void contextInitialized(javax.servlet.ServletContextEvent event)
- Specified by:
contextInitializedin interfacejavax.servlet.ServletContextListener
-
contextDestroyed
public void contextDestroyed(javax.servlet.ServletContextEvent event)
- Specified by:
contextDestroyedin interfacejavax.servlet.ServletContextListener
-
deregisterLocalProvidersForCategory
private static <T> void deregisterLocalProvidersForCategory(javax.imageio.spi.IIORegistry registry, IIOProviderContextListener.LocalFilter localFilter, java.lang.Class<T> category, javax.servlet.ServletContext context)
-
-