| Custom extension of the Spring PropertyPlaceholderConfigurer that
sets up the jtrac.home System property (creates if required) and also creates
a default jtrac.properties file for HSQLDB - useful for those who want
to quickly evaluate JTrac. Just dropping the war into a servlet container
would work without the need to even configure a datasource.
This class would effectively do nothing if a "jtrac.properties" file exists in jtrac.home
1) a "jtrac.home" property is looked for in /WEB-INF/classes/jtrac-init.properties
2) if not found, then a "jtrac.home" system property is checked for
3) then a servlet context init-parameter called "jtrac.home" is looked for
4) last resort, a ".jtrac" folder is created in the "user.home" and used as "jtrac.home"
Other tasks
- initialize the "test" query for checking idle database connections
- initialize list of available locales based on the properties files available
Also playing an important role during startup are the following factory beans:
- DataSourceFactoryBean:
switches between embedded HSQLDB or Apache DBCP (connection pool)
performs graceful shutdown of database if embedded HSQLDB
- ProviderManagerFactoryBean
conditionally includes LDAP authentication if requested
Note that later on during startup, the HibernateJtracDao would check if
database tables exist, and if they dont, would proceed to create them
|