/** * Uses the OperatingSystem information of the HostInfo to decide what library to load. On Windows the library name is "libzmq". On Linux the library * name is "zmq". * * @param hostInfo Based on the OperatingSystem member the needed Library will be loaded. */ protected void loadLibrary(HostInfo hostInfo) { if (hostInfo == null) { return; } // don't load native lib for jeromq profile if (getClass().getClassLoader().getResource("org/codehaus/fabric3/jeromq") != null) { return; } String osName = hostInfo.getOperatingSystem().getName().toLowerCase(); if (osName == null) { return; } for (ZMQLibraryInitializer lib : ZMQLibraryInitializer.values()) { if (osName.toLowerCase().contains(lib.name().toLowerCase())) { lib.loadLibrary(); return; } } }