code: 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;
      }
docs: 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!
  
  @param bundleContext the context to use to find the CDIService
  @return The application name