@Override
public void contextInitialized(ServletContextEvent event) {
// Create the runtime
ServletContext servletContext = event.getServletContext();
TomcatPropertiesProvider propsProvider = new TomcatPropertiesProvider(servletContext);
Runtime runtime = RuntimeLocator.createRuntime(new TomcatRuntimeFactory(servletContext), propsProvider);
runtime.init();
// Initialize ConfigurationAdmin content
Object configsDir = propsProvider.getProperty(Constants.PROPERTY_CONFIGURATIONS_DIR);
ActivationSupport.initConfigurationAdmin(new File((String) configsDir));
// Register the {@link RuntimeEnvironment}, {@link ResourceInstaller} services
registerServices(servletContext, runtime);