protected void buildSharedLibs()

in core/servicemix-core/src/main/java/org/apache/servicemix/jbi/framework/InstallationService.java [479:511]


    protected void buildSharedLibs() {
        // walk through shared libaries and add then to the ClassLoaderService
        File top = environmentContext.getSharedLibDir();
        if (top != null && top.exists() && top.isDirectory()) {
            // directory structure is sharedlibraries/<lib name>/version_x/stuff
            // ...
            File[] files = top.listFiles();
            if (files != null) {
                for (int i = 0; i < files.length; i++) {
                    if (!files[i].isDirectory()) {
                        continue;
                    }
                    File dir = FileVersionUtil.getLatestVersionDirectory(files[i]);
                    if (dir == null) {
                        continue;
                    }
                    Descriptor root = DescriptorFactory.buildDescriptor(dir);
                    if (root == null) {
                        continue;
                    }
                    SharedLibrary sl = root.getSharedLibrary();
                    if (sl == null) {
                        continue;
                    }
                    try {
                        container.getRegistry().registerSharedLibrary(sl, dir);
                    } catch (Exception e) {
                        LOGGER.error("Failed to initialize sharted library", e);
                    }
                }
            }
        }
    }