code: private Region getLibraryExporterRegion(final RegionDigraph digraph, final PackageVisibility visibility) throws BundleException {
          final String libertyExporterRegionName = getExportFromRegion(visibility);
          final Region existingLibraryExporter = digraph.getRegion(libertyExporterRegionName);
          if (existingLibraryExporter == null) {
              ApiRegion.update(digraph, new Callable<RegionDigraph>() {
                  @Override
                  public RegionDigraph call() throws Exception {
                      RegionDigraph copy = digraph.copy();
                      Region libraryExporter = copy.getRegion(libertyExporterRegionName);
                      if (libraryExporter != null) {
                          // another thread won creating the region
                          return null;
                      }
                      libraryExporter = copy.createRegion(libertyExporterRegionName);
                      // notice that we assume the exportTo region already exists.
                      // if it does not then we will get an NPE below.
                      Region exportTo = copy.getRegion(getExportToRegion(visibility));
                      RegionFilterBuilder builder = copy.createRegionFilterBuilder();
                      // allow all packages into the product hub so that all packages provided by 
                      // the library are visible for all liberty feature bundles to use.
                      builder.allowAll(RegionFilter.VISIBLE_PACKAGE_NAMESPACE);
                      exportTo.connectRegion(libraryExporter, builder.build());
                      return copy;
                  }
              });
              return digraph.getRegion(libertyExporterRegionName);
          }
          return existingLibraryExporter;
      }
docs: /*
  Gets or creates the region to install the exporting bundle to.
  The implementation only uses one of two regions.
  1) for all bundles that expose packages to the liberty kernel region
  2) for all bundles that expose packages to the osgi applications region for API access