Home / Function/ loadNativeLibrary() — netty Function Reference

loadNativeLibrary() — netty Function Reference

Architecture documentation for the loadNativeLibrary() function in Native.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  aeb1aabc_95f1_fac3_0006_559ec71af555["loadNativeLibrary()"]
  67956c01_800f_62e3_c02e_32defdb23f9b["Native"]
  aeb1aabc_95f1_fac3_0006_559ec71af555 -->|defined in| 67956c01_800f_62e3_c02e_32defdb23f9b
  style aeb1aabc_95f1_fac3_0006_559ec71af555 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/Native.java lines 325–344

    private static void loadNativeLibrary() {
        String name = PlatformDependent.normalizedOs();
        if (!"linux".equals(name)) {
            throw new IllegalStateException("Only supported on Linux");
        }
        String staticLibName = "netty_transport_native_epoll";
        String sharedLibName = staticLibName + '_' + PlatformDependent.normalizedArch();
        ClassLoader cl = PlatformDependent.getClassLoader(Native.class);
        try {
            NativeLibraryLoader.load(sharedLibName, cl);
        } catch (UnsatisfiedLinkError e1) {
            try {
                NativeLibraryLoader.load(staticLibName, cl);
                logger.debug("Failed to load {}", sharedLibName, e1);
            } catch (UnsatisfiedLinkError e2) {
                ThrowableUtil.addSuppressed(e1, e2);
                throw e1;
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does loadNativeLibrary() do?
loadNativeLibrary() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/Native.java.
Where is loadNativeLibrary() defined?
loadNativeLibrary() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/Native.java at line 325.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free