boolean loadCandidateLibrary(String aLibraryName, Long aMajorVersion,
      List<String> aLibCandidates)
  {
    boolean retval = false;
    for (String candidate : aLibCandidates)
    {
      log
          .trace(
              "Attempt: library load of library: {}; version: {}: relative path: {}",
              new Object[]
              {
                  aLibraryName,
                  aMajorVersion == null ? "<unspecified>" : aMajorVersion
                      .longValue(), candidate
              });
      File candidateFile = new File(candidate);
      if (candidateFile.exists())
      {
        String absPath = candidateFile.getAbsolutePath();
        try
        {
          log
              .trace(
                  "Attempt: library load of library: {}; version: {}: absolute path: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath
                  });
          // Here's where we attempt the actual load.
          System.load(absPath);
          log
              .trace(
                  "Success: library load of library: {}; version: {}: absolute path: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath
                  });
          // if we got here, we loaded successfully
          setLoadedLibrary(aLibraryName, aMajorVersion);
          retval = true;
          break;
        }
        catch (UnsatisfiedLinkError e)
        {
          log
              .warn(
                  "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath, e
                  });
        }
        catch (SecurityException e)
        {
          log
              .warn(
                  "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath, e
                  });
        }
      }
    }
    return retval;
  }
boolean loadCandidateLibrary(String aLibraryName, Long aMajorVersion,
      List<String> aLibCandidates)
  {
    boolean retval = false;
    for (String candidate : aLibCandidates)
    {
      log
          .trace(
              "Attempt: library load of library: {}; version: {}: relative path: {}",
              new Object[]
              {
                  aLibraryName,
                  aMajorVersion == null ? "<unspecified>" : aMajorVersion
                      .longValue(), candidate
              });
      File candidateFile = new File(candidate);
      if (candidateFile.exists())
      {
        String absPath = candidateFile.getAbsolutePath();
        try
        {
          log
              .trace(
                  "Attempt: library load of library: {}; version: {}: absolute path: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath
                  });
          
          System.load(absPath);
          log
              .trace(
                  "Success: library load of library: {}; version: {}: absolute path: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath
                  });
          
          setLoadedLibrary(aLibraryName, aMajorVersion);
          retval = true;
          break;
        }
        catch (UnsatisfiedLinkError e)
        {
          log
              .warn(
                  "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath, e
                  });
        }
        catch (SecurityException e)
        {
          log
              .warn(
                  "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}",
                  new Object[]
                  {
                      aLibraryName,
                      aMajorVersion == null ? "<unspecified>" : aMajorVersion
                          .longValue(), absPath, e
                  });
        }
      }
    }
    return retval;
  }
boolean loadCandidateLibrary ( String aLibraryName , Long aMajorVersion , List < String > aLibCandidates ) { boolean retval = false ; for ( String candidate : aLibCandidates ) { log . trace ( "Attempt: library load of library: {}; version: {}: relative path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , candidate } ) ; File candidateFile = new File ( candidate ) ; if ( candidateFile . exists ( ) ) { String absPath = candidateFile . getAbsolutePath ( ) ; try { log . trace ( "Attempt: library load of library: {}; version: {}: absolute path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath } ) ; // Here's where we attempt the actual load. System . load ( absPath ) ; log . trace ( "Success: library load of library: {}; version: {}: absolute path: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath } ) ; // if we got here, we loaded successfully setLoadedLibrary ( aLibraryName , aMajorVersion ) ; retval = true ; break ; } catch ( UnsatisfiedLinkError e ) { log . warn ( "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath , e } ) ; } catch ( SecurityException e ) { log . warn ( "Failure: library load of library: {}; version: {}: absolute path: {}; error: {}" , new Object [ ] { aLibraryName , aMajorVersion == null ? "<unspecified>" : aMajorVersion . longValue ( ) , absPath , e } ) ; } } } return retval ; }
Iterates through the set of aLibCandidates until it succeeds in loading a
library. If it succeeds, it lets the cache know.

@param aLibraryName
The library name.
@param aMajorVersion
The version we want, or null if we don't care.
@param aLibCandidates
The set of candidates generated by
{@link #getLibraryCandidates(String, Long)}
@return true if we succeeded in loading a library; false otherwise
Iterates through the set of aLibCandidates until it succeeds in loading a library . If it succeeds it lets the cache know .