toolbox.web
Class ServiceRegistryShutdownListener

Package class diagram package ServiceRegistryShutdownListener
java.lang.Object
  extended by toolbox.web.ServiceRegistryShutdownListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class ServiceRegistryShutdownListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

Simple ServletContextListener implementation to shut down a specific toolbox.services.ServiceRegistty instance when the servlet context is unloaded.

This implementation requires the existence of a single context init parameter named toolbox.services.ServiceRegistry.name that contains the name of the registry that must be destroyed.


Constructor Summary
ServiceRegistryShutdownListener()
          Default constructor.
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent sce)
          Receives notification that the web application is being shut down.
 void contextInitialized(javax.servlet.ServletContextEvent sce)
          Receives notification that the web application is initialising.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRegistryShutdownListener

public ServiceRegistryShutdownListener()
Default constructor.

Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent sce)
Receives notification that the web application is initialising. This implementation is empty.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
Parameters:
sce - ServiceContextEvent instance.

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent sce)
Receives notification that the web application is being shut down. This implementation obtains the registry context parameter and destroys the specific registry.

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
Parameters:
sce - ServiceContextEvent instance.