code: static Library getSharedLibrary(String id) {
  
          if (bundleContext == null) {
              return null;
          }
  
          // Filter the SharedLibrary service references by ID.
          String filter = "(" + "id=" + id + ")";
          Collection<ServiceReference<Library>> refs = null;
          try {
              refs = bundleContext.getServiceReferences(Library.class, filter);
          } catch (InvalidSyntaxException e) {
              if (tc.isErrorEnabled()) {
                  Tr.error(tc, "cls.library.id.invalid", id, e.toString());
              }
              return null;
          }
  
          if (refs.isEmpty())
              return null;
  
          return bundleContext.getService(getHighestRankedService(refs));
      }
docs: Retrieve a library from the service registry.
  
  @return A library with the given id or <code>null</code> if no match was found