com.softslate.commerce.customer.core
Class ConfigPlugIn

java.lang.Object
  extended by com.softslate.commerce.customer.core.ConfigPlugIn
All Implemented Interfaces:
org.apache.struts.action.PlugIn

public class ConfigPlugIn
extends java.lang.Object
implements org.apache.struts.action.PlugIn

Initializes singleton objects in the application scope. Called by Struts as a PlugIn as the application is loaded, and by BaseRequestProcessor at the beginning of a request, if the singletons are found to be missing.

Author:
David Tobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
private  javax.servlet.GenericServlet servlet
           
 
Constructor Summary
ConfigPlugIn()
           
ConfigPlugIn(org.apache.struts.action.ActionServlet servlet)
           
ConfigPlugIn(javax.servlet.GenericServlet servlet)
           
 
Method Summary
 void destroy()
          Close the Hibernate SessionFactory as the application shuts down.
 javax.servlet.GenericServlet getServlet()
           
 void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig)
           
 void initializeAppComponents()
          Creates an instance of java.util.Properties representing component settings in the application scope.
 void initializeAppSettings()
          Creates an instance of java.util.Properties representing application settings in the application scope.
 void initializeDAOFactory()
          Creates a configured instance of DAOFactory in the application scope.
 void processPostDatabaseUpgrades()
           
 void processPreDatabaseUpgrades()
           
 void processUpgrade2dot1()
           
 void processUpgrade2dot2()
           
 void processUpgrade2dot2dot5()
           
 void processUpgrade2dot3dot2()
           
 void processUpgrade2dot3dot5()
           
 void processUpgrade3dot0dot0()
           
 void saveComponents(java.util.Properties appComponents)
          Saves a new set of properties to the /WEB-INF/classes/appComponents.properties file.
 void setServlet(javax.servlet.GenericServlet servlet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static org.apache.commons.logging.Log log

servlet

private javax.servlet.GenericServlet servlet
Constructor Detail

ConfigPlugIn

public ConfigPlugIn()

ConfigPlugIn

public ConfigPlugIn(org.apache.struts.action.ActionServlet servlet)

ConfigPlugIn

public ConfigPlugIn(javax.servlet.GenericServlet servlet)
Method Detail

getServlet

public javax.servlet.GenericServlet getServlet()

setServlet

public void setServlet(javax.servlet.GenericServlet servlet)

init

public void init(org.apache.struts.action.ActionServlet servlet,
                 org.apache.struts.config.ModuleConfig moduleConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface org.apache.struts.action.PlugIn
Throws:
javax.servlet.ServletException

initializeAppSettings

public void initializeAppSettings()
Creates an instance of java.util.Properties representing application settings in the application scope. Reads in the properties from the "/WEB-INF/classes/appSettings.properties" file, using AppUtils.loadProperties(java.lang.String, javax.servlet.ServletContext).


initializeAppComponents

public void initializeAppComponents()
                             throws javax.servlet.ServletException
Creates an instance of java.util.Properties representing component settings in the application scope. Component settings define which classes implement the various application interfaces used by the application's code. Reads in the properties from the "/WEB-INF/classes/appComponents.properties" file, using AppUtils.loadProperties(java.lang.String, javax.servlet.ServletContext).

Throws:
javax.servlet.ServletException

initializeDAOFactory

public void initializeDAOFactory()
Creates a configured instance of DAOFactory in the application scope.

If successful, the "daoFactory" attribute of the servlet context will contain a DAOFactory that allows the DAOs it creates to to communicate with the database through Hibernate.


destroy

public void destroy()
Close the Hibernate SessionFactory as the application shuts down.

Specified by:
destroy in interface org.apache.struts.action.PlugIn

processPreDatabaseUpgrades

public void processPreDatabaseUpgrades()

processPostDatabaseUpgrades

public void processPostDatabaseUpgrades()

processUpgrade2dot1

public void processUpgrade2dot1()

processUpgrade2dot2

public void processUpgrade2dot2()

processUpgrade2dot2dot5

public void processUpgrade2dot2dot5()

processUpgrade2dot3dot2

public void processUpgrade2dot3dot2()

processUpgrade2dot3dot5

public void processUpgrade2dot3dot5()

processUpgrade3dot0dot0

public void processUpgrade3dot0dot0()

saveComponents

public void saveComponents(java.util.Properties appComponents)
                    throws java.lang.Exception
Saves a new set of properties to the /WEB-INF/classes/appComponents.properties file.

Parameters:
appComponents - The new set of properties to be saved.
Throws:
java.lang.Exception


Copyright © SoftSlate, LLC 2003–2005