org.apache.shale.clay.config
Class ClayConfigureListener

java.lang.Object
  extended by org.apache.shale.clay.config.ClayConfigureListener
All Implemented Interfaces:
EventListener, ServletContextListener

public class ClayConfigureListener
extends Object
implements ServletContextListener

This context listener is responsible for loading the clay configuration files on application startup. It is registered in our tag library descriptor, so no further registration is required. The configuration files are defined by a context initialization parameter named Globals.CLAY_CONFIG_FILES.

After the data is loaded, it will be accessible using the factory class ConfigBeanFactory


Constructor Summary
ClayConfigureListener()
           
 
Method Summary
 void contextDestroyed(ServletContextEvent event)
          Tear down the factories and clean house.
 void contextInitialized(ServletContextEvent event)
          Loads the configuration files on startup into an instance of ComponentConfigBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClayConfigureListener

public ClayConfigureListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)

Loads the configuration files on startup into an instance of ComponentConfigBean. and registers it with the factory ConfigBeanFactory. The HTML template style of Clay configuration bean TemplateConfigBean and the XML template style of configuration bean is TemplateComponentConfigBean. The are all registered with the factory ConfigBeanFactory. All configuration bean pools implement the ConfigBean interface.

Specified by:
contextInitialized in interface ServletContextListener
Parameters:
event - servlet context
See Also:
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)

contextDestroyed

public void contextDestroyed(ServletContextEvent event)

Tear down the factories and clean house.

Specified by:
contextDestroyed in interface ServletContextListener
Parameters:
event - servlet context
See Also:
ServletContextListener.contextDestroyed(javax.servlet.ServletContextEvent)


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.