code: public static SortedSet<Configuration> getConfigurations(BundleContext bundleContext, String applicationName) {
  
          //sorting the Configuration objects by their PID which are in the format "appProperties.property_xx" where xx is an incrementing integer
          //so the first one discovered might be "appProperties.property_17" and the second one is "appProperties.property_18"
          //This ordering is not a defined API but I'm hoping that it won't change
          SortedSet<Configuration> configSet = new TreeSet<>((o1, o2) -> o1.getPid().compareTo(o2.getPid()));
  
          if (FrameworkState.isValid()) {
              try {
                  String applicationPID = getApplicationPID(bundleContext, applicationName);
                  String applicationPropertiesPid = null;
                  ConfigurationAdmin admin = getConfigurationAdmin(bundleContext);
                  if (applicationPID != null && admin != null) {
                      String appPropertiesFilter = getApplicationPropertiesConfigFilter(applicationPID);
                      Configuration[] appPropertiesOsgiConfigs = admin.listConfigurations(appPropertiesFilter);
                      if (appPropertiesOsgiConfigs != null) {
                          for (Configuration cfg : appPropertiesOsgiConfigs) {
                              applicationPropertiesPid = cfg.getPid();
                          }
                      }
  
                      if (applicationPropertiesPid != null) {
                          String appPropertiesPropertyFilter = getApplicationPropertiesPropertyConfigFilter(applicationPropertiesPid);
                          Configuration[] appPropertiesPropertyOsgiConfigs = admin.listConfigurations(appPropertiesPropertyFilter);
                          if (appPropertiesPropertyOsgiConfigs != null) {
                              for (Configuration cfg : appPropertiesPropertyOsgiConfigs) {
                                  configSet.add(cfg);
                              }
                          }
                      }
                  }
              } catch (IOException |
  
                              InvalidSyntaxException e) {
                  throw new ConfigException(e);
              }
          }
  
          return configSet;
      }
docs: Get the Configuration object which represents a <appProperties> element in the server.xml for a given application
  
  @param bundleContext The context to use in looking up OSGi service references
  @param applicationName The application name to look for
  @return The Configuration instance