Class ConfigPlugIn
java.lang.Object
com.softslate.commerce.customer.core.ConfigPlugIn
- All Implemented Interfaces:
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
-
Constructor Summary
ConstructorDescriptionConfigPlugIn
(javax.servlet.GenericServlet servlet) ConfigPlugIn
(org.apache.struts.action.ActionServlet servlet) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Close the Hibernate SessionFactory as the application shuts down.javax.servlet.GenericServlet
void
init
(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig moduleConfig) void
Creates an instance ofjava.util.Properties
representing component settings in the application scope.void
Creates an instance ofjava.util.Properties
representing application settings in the application scope.void
Creates a configured instance ofDAOFactory
in the application scope.protected void
protected void
void
void
void
void
void
void
void
void
saveComponents
(Properties appComponents) Saves a new set of properties to the /WEB-INF/classes/appComponents.properties file.void
setServlet
(javax.servlet.GenericServlet servlet)
-
Field Details
-
log
static org.apache.commons.logging.Log log -
servlet
private javax.servlet.GenericServlet servlet
-
-
Constructor Details
-
ConfigPlugIn
public ConfigPlugIn() -
ConfigPlugIn
public ConfigPlugIn(org.apache.struts.action.ActionServlet servlet) -
ConfigPlugIn
public ConfigPlugIn(javax.servlet.GenericServlet servlet)
-
-
Method Details
-
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 interfaceorg.apache.struts.action.PlugIn
- Throws:
javax.servlet.ServletException
-
initPropertyUtilsConfig
protected void initPropertyUtilsConfig() -
initializeAppSettings
public void initializeAppSettings()Creates an instance ofjava.util.Properties
representing application settings in the application scope. Reads in the properties from the "/WEB-INF/classes/appSettings.properties" file, usingAppUtils.loadProperties(java.lang.String, javax.servlet.ServletContext)
. -
initializeAppComponents
public void initializeAppComponents() throws javax.servlet.ServletExceptionCreates an instance ofjava.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, usingAppUtils.loadProperties(java.lang.String, javax.servlet.ServletContext)
.- Throws:
javax.servlet.ServletException
-
initializeDAOFactory
public void initializeDAOFactory()Creates a configured instance ofDAOFactory
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. -
processLiquibaseUpdates
protected void processLiquibaseUpdates() -
destroy
public void destroy()Close the Hibernate SessionFactory as the application shuts down.- Specified by:
destroy
in interfaceorg.apache.struts.action.PlugIn
-
processPreDatabaseUpgrades
public void processPreDatabaseUpgrades() -
processPostDatabaseUpgrades
public void processPostDatabaseUpgrades() -
processUpgrade2dot1
public void processUpgrade2dot1() -
processUpgrade2dot2
public void processUpgrade2dot2() -
processUpgrade2dot2dot5
public void processUpgrade2dot2dot5() -
processUpgrade2dot3dot5
public void processUpgrade2dot3dot5() -
processUpgrade3dot0dot0
public void processUpgrade3dot0dot0() -
saveComponents
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:
Exception
-