in java/main/src/main/java/com/epam/deltix/utilities/ResourceLoader.java [541:582]
private void loadDynamicLibraries(final Path deploymentPath) {
int numLoaded = 0;
boolean loadedLeastOne;
Throwable exception = null;
// Sort for loading
Collections.sort(_resources);
do {
loadedLeastOne = false;
for (final Resource resource : _resources) {
if (resource.isDll && !resource.isLoaded()) {
final Path path = resource.getFullPath(deploymentPath);
if (logLevelLeast(DBG))
log("Loading library #%s: '%s', exists: %s, hasLockFile: %s",
numLoaded + 1, path, Files.exists(path), null != resource._fileLock);
try {
System.load(path.toString());
} catch (final SecurityException | LinkageError e) {
exception = e;
if (logLevelLeast(DBG))
log("LoadLibrary Exception: %s", e.getMessage());
continue;
}
resource.setLoaded(true);
++numLoaded;
loadedLeastOne = true;
}
}
} while (loadedLeastOne);
if (null != exception) {
// Avoid 'throws'
if (exception instanceof SecurityException) {
throw (RuntimeException) exception;
} else {
throw (LinkageError) exception;
}
}
}