public static String getCDIAppName ( BundleContext bundleContext ) { String appName = null ; if ( FrameworkState . isValid ( ) ) { // Get the CDIService CDIService cdiService = getCDIService ( bundleContext ) ; if ( cdiService != null ) { appName = cdiService . getCurrentApplicationContextID ( ) ; } } return appName ; }
Get the current application name using the CDIService . During CDI startup the CDIService knows which application it is currently working with so we can ask it!