protected void createDirectJNgineRouter(ServletConfig configuration) throws ServletException {
assert configuration != null;
Timer subtaskTimer = new Timer();
GlobalConfiguration globalConfiguration = createGlobalConfiguration(configuration);
String registryConfiguratorClassName = ServletUtils.getParameter(configuration, REGISTRY_CONFIGURATOR_CLASS, null);
if( logger.isInfoEnabled() ) {
String value = registryConfiguratorClassName;
if( value == null) {
value = "";
}
logger.info( "Servlet GLOBAL configuration: " + REGISTRY_CONFIGURATOR_CLASS + "=" + value );
}
Class<? extends ServletRegistryConfigurator> registryConfiguratorClass = getRegistryConfiguratorClass(registryConfiguratorClassName);
List<ApiConfiguration> apiConfigurations = createApiConfigurationsFromServletConfigurationApi(configuration);
subtaskTimer.stop();
subtaskTimer.logDebugTimeInMilliseconds("Djn initialization: Servlet Configuration Load time");
subtaskTimer.restart();
Registry registry = new Registry( globalConfiguration );
Scanner scanner = new Scanner(registry);
scanner.scanAndRegisterApiConfigurations( apiConfigurations );
subtaskTimer.stop();
subtaskTimer.logDebugTimeInMilliseconds("Djn initialization: Standard Api processing time");
if( registryConfiguratorClass != null ) {
subtaskTimer.restart();
performCustomRegistryConfiguration( registryConfiguratorClass, registry, configuration );
subtaskTimer.stop();
subtaskTimer.logDebugTimeInMilliseconds("Djn initialization: Custom Registry processing time");
}
subtaskTimer.restart();
try {
CodeFileGenerator.updateSource(registry, globalConfiguration.getCreateSourceFiles());
subtaskTimer.stop();
subtaskTimer.logDebugTimeInMilliseconds("Djn initialization: Api Files creation time");
}
catch( IOException ex ) {
ServletException e = new ServletException( "Unable to create DirectJNgine API files", ex );