@ Override public void contextInitialized ( final ServletContextEvent servletContextEvent ) { servletContext = servletContextEvent . getServletContext ( ) ; Latkes . init ( ) ; LOGGER . info ( "Initializing the context...." ) ; Latkes . setLocale ( Locale . SIMPLIFIED_CHINESE ) ; LOGGER . log ( Level . INFO , "Default locale [{0}]" , Latkes . getLocale ( ) ) ; final String realPath = servletContext . getRealPath ( "/" ) ; LOGGER . log ( Level . INFO , "Server [realPath={0}, contextPath={1}]" , realPath , servletContext . getContextPath ( ) ) ; try { final Collection < Class < ? > > beanClasses = Discoverer . discover ( Latkes . getScanPath ( ) ) ; BeanManager . start ( beanClasses ) ; } catch ( final Exception e ) { LOGGER . log ( Level . ERROR , "Initializes request processors failed" , e ) ; throw new IllegalStateException ( "Initializes request processors failed" ) ; } }
Initializes context locale and runtime environment .