private Dictionary < String , Object > buildServicePropsAndFilterTargets ( String pid , Dictionary < String , Object > config ) throws IOException , InvalidSyntaxException { Dictionary < String , Object > result = new Hashtable < String , Object > ( ) ; // we will use this later to discover the properties configured in this classloader element in config result . put ( "classloader.config.pid" , pid ) ; // Add the application so other DS components can key from this new classloader sevice String appFilter = "(classloader=" + pid + ")" ; Configuration [ ] appConfigs = configAdmin . listConfigurations ( appFilter ) ; if ( appConfigs . length == 1 ) { Configuration appConfig = appConfigs [ 0 ] ; Dictionary < String , Object > properties = appConfig . getProperties ( ) ; String appName = ( String ) properties . get ( "name" ) ; if ( appName != null ) { result . put ( "application.name" , appName ) ; } String appConfigPid = ( String ) properties . get ( "service.pid" ) ; try { result . put ( "application.pid" , appConfigPid ) ; } catch ( NullPointerException swallowed ) { /* this will be FFDC'd */ if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "service.pid is null" , swallowed ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Creating ApplicationClassloadingService for application" + appName ) ; } List < String > allLibraries = new ArrayList < String > ( ) ; String [ ] privateLibraryRefs = ( String [ ] ) config . get ( LIBRARY_REF_ATT ) ; if ( privateLibraryRefs != null ) { allLibraries . addAll ( Arrays . asList ( privateLibraryRefs ) ) ; } String [ ] commonLibraryRefs = ( String [ ] ) config . get ( COMMON_LIBRARY_REF_ATT ) ; if ( commonLibraryRefs != null ) { allLibraries . addAll ( Arrays . asList ( commonLibraryRefs ) ) ; } if ( allLibraries . size ( ) > 0 ) { String filter = buildTargetString ( allLibraries ) ; result . put ( "libraryStatus.target" , filter ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "This application will wait for the following libraries " , filter ) ; } else { // we need to clear the blocking target and make sure we // do get activated by setting a target we know will happen result . put ( "libraryStatus.target" , "(id=global)" ) ; } return result ; }
Add the properties for this new service to allow other components locate this service