private void dispatchInitializationEvent ( ServletContextEvent event , int operation ) { if ( operation == FACES_INIT_PHASE_PREINIT ) { if ( ! loadFacesInitPluginsJDK6 ( ) ) { loadFacesInitPluginsJDK5 ( ) ; } } List < StartupListener > pluginEntries = ( List < StartupListener > ) _servletContext . getAttribute ( FACES_INIT_PLUGINS ) ; if ( pluginEntries == null ) { return ; } //now we process the plugins for ( StartupListener initializer : pluginEntries ) { log . info ( "Processing plugin" ) ; //for now the initializers have to be stateless to //so that we do not have to enforce that the initializer //must be serializable switch ( operation ) { case FACES_INIT_PHASE_PREINIT : initializer . preInit ( event ) ; break ; case FACES_INIT_PHASE_POSTINIT : initializer . postInit ( event ) ; break ; case FACES_INIT_PHASE_PREDESTROY : initializer . preDestroy ( event ) ; break ; default : initializer . postDestroy ( event ) ; break ; } } log . info ( "Processing MyFaces plugins done" ) ; }
the central initialisation event dispatcher which calls our listeners