com.acsinet_solutions.cetia4.controller.support
Class ServiceInitializerBase

java.lang.Object
  extended by com.acsinet_solutions.cetia4.controller.support.ServiceInitializerBase
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public abstract class ServiceInitializerBase
extends java.lang.Object
implements javax.servlet.ServletContextListener

Basic class for service initializers. Performs classloader operations and contains common loading logic.

Author:
Santiago Arriaga

Constructor Summary
protected ServiceInitializerBase()
          Constructor for no service locator creation.
protected ServiceInitializerBase(java.lang.Class serviceLocatorClass)
          Protected constructor that receives the necessary parameters to perform the Spring initialization.
protected ServiceInitializerBase(java.lang.Class serviceLocatorClass, java.lang.String configurationFile)
          Protected constructor that receives the necessary parameters to perform the Spring initialization.
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent event)
           
 void contextInitialized(javax.servlet.ServletContextEvent event)
          This method loads the service locator.
protected  void loadCatalogs(javax.servlet.ServletContext context, ServiceLocator locator)
          This hook method may be used by subclasses to perform resource initialization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceInitializerBase

protected ServiceInitializerBase(java.lang.Class serviceLocatorClass,
                                 java.lang.String configurationFile)
Protected constructor that receives the necessary parameters to perform the Spring initialization.


ServiceInitializerBase

protected ServiceInitializerBase(java.lang.Class serviceLocatorClass)
Protected constructor that receives the necessary parameters to perform the Spring initialization.


ServiceInitializerBase

protected ServiceInitializerBase()
Constructor for no service locator creation.

Method Detail

contextInitialized

public final void contextInitialized(javax.servlet.ServletContextEvent event)
This method loads the service locator. A class loader change is temporarily performed to avoid problems of classloading in containers such as websphere.

The locale and bundle parameters are initialized in this method and also the _BUNDLE_KEY entry. Currently no way to avoid that behavior is provided, but may be implemented if necessary for future versions.

The service locator is loaded, if configured.

Catalogs are loaded using introspection or using the overridable loadCatalogs() method.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

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

loadCatalogs

protected void loadCatalogs(javax.servlet.ServletContext context,
                            ServiceLocator locator)
This hook method may be used by subclasses to perform resource initialization. Introspection facilities may also be used. By default this method does nothing.