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$
Author:
Harald Kuhr, last modified by $Author: haraldk$
See Also:
  • Constructor Details

    • IIOProviderContextListener

      public IIOProviderContextListener()
  • Method Details

    • contextInitialized

      public void contextInitialized(javax.servlet.ServletContextEvent event)
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
    • contextDestroyed

      public void contextDestroyed(javax.servlet.ServletContextEvent event)
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener