@ Trivial //trace is manually added. @ Override public void notificationCreated ( RuntimeUpdateManager updateManager , RuntimeUpdateNotification notification ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "notificationCreated" , notification . getName ( ) ) ; if ( configChecked ) { if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "notificationCreated: early return." , notification . getName ( ) ) ; return ; } if ( ! configChecked && RuntimeUpdateNotification . APPLICATIONS_STARTING . equals ( notification . getName ( ) ) ) { configChecked = true ; try { String sessionCacheConfigFilter = FilterUtils . createPropertyFilter ( Constants . SERVICE_PID , "com.ibm.ws.session.cache" ) ; Configuration [ ] sessionCacheConfigurations = configAdmin . listConfigurations ( sessionCacheConfigFilter ) ; if ( sessionCacheConfigurations . length != 1 ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "There should always be one exactly one sessionCacheConfiguration. " + "Number of sessionCacheConfigurations found = " + sessionCacheConfigurations . length ) ; } if ( sessionCacheConfigurations != null ) { for ( Configuration configuration : sessionCacheConfigurations ) { if ( configuration == null ) { continue ; } Dictionary < String , Object > props = configuration . getProperties ( ) ; String [ ] libraryRefs = ( String [ ] ) props . get ( "libraryRef" ) ; if ( libraryRefs == null ) { if ( ! isSessionCacheBellConfigured ( ) ) { Tr . error ( tc , "ERROR_CONFIG_INVALID_HTTPSESSIONCACHE" , Tr . formatMessage ( tc , "SESSION_CACHE_CONFIG_MESSAGE" , sampleConfig ) ) ; } } else if ( libraryRefs . length == 0 ) { Tr . debug ( tc , "The libraryRef attribute of the httpSessionCache in the server configuration could not be resolved. " + "Check for possible CWWKG0033W messages." ) ; } else { //verify that the libraryRef points to a valid library configuration object. Configuration libraryConfiguration = configAdmin . getConfiguration ( libraryRefs [ 0 ] ) ; if ( libraryConfiguration != null ) { //We found nothing wrong with the configuration. if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "A httpSessionCache configuration with a valid libraryRef was found." ) ; } else { //This case should not be possible. //If the libraryRef is missing then libraryRefs is null. //If the libraryRef points to an invalid library, libraryRefs length is 0. //If there is more than one libraryRef, a CWWKG0014E error will have already been thrown. if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "A httpSessionCache configuration with a valid libraryRef was found, " + "but the configuration the libraryRef points to is null. " + "This should never happen." ) ; } } } } } catch ( InvalidSyntaxException | IOException ex ) { //Something unexpected happened, log the exception as an error. Tr . error ( tc , "ERROR_SESSION_INIT" , ex ) ; } } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "notificationCreated" , notification . getName ( ) ) ; }
Perform validation checking on the sessionCache feature s configuration .