private ApplicationConfigurationContext generateApplicationConfigurationContext(ServletContextEvent contextEvent) {
String applicationPath = contextEvent.getServletContext().getRealPath("/");
String applicationName = getApplicationName(contextEvent.getServletContext().getContextPath());
ApplicationConfigurationContext applicationConfigurationContext = new ApplicationConfigurationContext();
applicationConfigurationContext.setApplicationName(applicationName);
applicationConfigurationContext.setApplicationPath(applicationPath);
String configurationType = contextEvent.getServletContext().getInitParameter("configuration-type");
if("xml-configuration".equalsIgnoreCase(configurationType)) {
applicationConfigurationContext.setConfigurationType(ConfigurationType.XML);
}
return applicationConfigurationContext;
}