code: public static synchronized Namespaces loadNamespaces() throws IOException,
              ResourceDownloadError, XMLStreamException,
              BELDataMissingPropertyException, BELDataConversionException {
          if (instance == null) {
              instance = new Namespaces();
  
              final CacheableResourceService c = new DefaultCacheableResourceService();
              final NamespaceHeaderParser p = new NamespaceHeaderParser();
  
              final SystemConfiguration sysConfig = getSystemConfiguration();
              final String resourceIndexURL = sysConfig.getResourceIndexURL();
              File indexFile = new File(resourceIndexURL);
              if (!indexFile.exists() || !indexFile.canRead()) {
                  // try the index as an online resource.
                  ResolvedResource resolvedResource = c.resolveResource(
                          ResourceType.RESOURCE_INDEX, resourceIndexURL);
                  indexFile = resolvedResource.getCacheResourceCopy();
              }
  
              final ResourceIndex ri = ResourceIndex.INSTANCE;
              ri.loadIndex(indexFile);
              final Index index = ri.getIndex();
  
  
              final List<ResourceLocation> nsr = index.getNamespaceResources();
              final Map<String, NamespaceHeader> hvals;
              if (hasItems(nsr)) {
                  hvals = new LinkedHashMap<String, NamespaceHeader>(index
                          .getNamespaceResources().size());
                  for (ResourceLocation rl : index.getNamespaceResources()) {
                      String loc = rl.getResourceLocation();
                      ResolvedResource nsResource = c.resolveResource(
                              ResourceType.NAMESPACES, loc);
                      NamespaceHeader header = p.parseNamespace(loc,
                              nsResource.getCacheResourceCopy());
                      hvals.put(loc, header);
                  }
              } else {
                  hvals = new LinkedHashMap<String, NamespaceHeader>();
              }
  
              headers = Collections.unmodifiableMap(hvals);
          }
  
          return instance;
      }
docs: Load {@link Namespace namespaces} supported by the BEL Framework
  instance.  This synchrononized static method creates the singleton
  instance of {@link Namespaces} and loads the namespaces on first call.
  
  @return {@link Namespaces} singleton instance
  @throws IOException Thrown if an error occurred loading BEL Framework
  resources
  @throws ResourceDownloadError Thrown if a download error occurred with
  a namespace resource location
  @throws XMLStreamException Thrown if an xml error occurred parsing the
  resource index file
  @throws BELDataMissingPropertyException Thrown if the namespace
  header definition is invalid
  @throws BELDataConversionException Thrown if the namespace
  header definition is invalid