Class IIOProviderContextListener
java.lang.Object
com.twelvemonkeys.servlet.image.IIOProviderContextListener
- All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener
public final class IIOProviderContextListener
extends Object
implements javax.servlet.ServletContextListener
Takes care of registering and de-registering local ImageIO plugins (service providers) for the servlet context.
Registers all available plugins on contextInitialized event, using ImageIO.scanForPlugins(), to make
sure they are available to the current servlet context.
De-registers all plugins which have the current thread's context class loader
as its class loader on contextDestroyed event, to avoid class/resource leak.
- Version:
- $Id: IIOProviderContextListener.java,v 1.0 14.02.12 21:53 haraldk Exp$
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextDestroyed(javax.servlet.ServletContextEvent event) voidcontextInitialized(javax.servlet.ServletContextEvent event) private static <T> voidderegisterLocalProvidersForCategory(IIORegistry registry, IIOProviderContextListener.LocalFilter localFilter, Class<T> category, javax.servlet.ServletContext context)
-
Constructor Details
-
IIOProviderContextListener
public IIOProviderContextListener()
-
-
Method Details
-
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(IIORegistry registry, IIOProviderContextListener.LocalFilter localFilter, Class<T> category, javax.servlet.ServletContext context)
-