Home / Class/ UnguardedLocalPool Class — netty Architecture

UnguardedLocalPool Class — netty Architecture

Architecture documentation for the UnguardedLocalPool class in Recycler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f5c7c86c_5bbe_d9f4_c2c9_a29143afbe3c["UnguardedLocalPool"]
  92da7dba_a9f6_c802_c3c1_5a54e228e444["Recycler.java"]
  f5c7c86c_5bbe_d9f4_c2c9_a29143afbe3c -->|defined in| 92da7dba_a9f6_c802_c3c1_5a54e228e444
  55b1e13a_1737_0bfe_03ed_525a34eee479["UnguardedLocalPool()"]
  f5c7c86c_5bbe_d9f4_c2c9_a29143afbe3c -->|method| 55b1e13a_1737_0bfe_03ed_525a34eee479
  bd74fca6_e421_c320_70a5_4c5be7dd7f9b["T()"]
  f5c7c86c_5bbe_d9f4_c2c9_a29143afbe3c -->|method| bd74fca6_e421_c320_70a5_4c5be7dd7f9b

Relationship Graph

Source Code

common/src/main/java/io/netty/util/Recycler.java lines 472–498

    private static final class UnguardedLocalPool<T> extends LocalPool<T, T> {
        private final EnhancedHandle<T> handle;

        UnguardedLocalPool(int maxCapacity) {
            super(maxCapacity);
            handle = maxCapacity == 0? null : new LocalPoolHandle<>(this);
        }

        UnguardedLocalPool(Thread owner, int maxCapacity, int ratioInterval, int chunkSize) {
            super(owner, maxCapacity, ratioInterval, chunkSize);
            handle = new LocalPoolHandle<>(this);
        }

        UnguardedLocalPool(int maxCapacity, int ratioInterval, int chunkSize) {
            super(maxCapacity, ratioInterval, chunkSize);
            handle = new LocalPoolHandle<>(this);
        }

        @Override
        public T getWith(Recycler<T> recycler) {
            T obj = acquire();
            if (obj == null) {
                obj = recycler.newObject(canAllocatePooled()? handle : (Handle<T>) NOOP_HANDLE);
            }
            return obj;
        }
    }

Frequently Asked Questions

What is the UnguardedLocalPool class?
UnguardedLocalPool is a class in the netty codebase, defined in common/src/main/java/io/netty/util/Recycler.java.
Where is UnguardedLocalPool defined?
UnguardedLocalPool is defined in common/src/main/java/io/netty/util/Recycler.java at line 472.

Analyze Your Own Codebase

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

Try Supermodel Free