Class ConstructorCache
- java.lang.Object
-
- software.amazon.awssdk.checksums.internal.ConstructorCache
-
@SdkInternalApi public final class ConstructorCache extends Object
A cache that stores classes and exposes a method to retrieve its zero-argument constructor.This cache stores weak references to loaded classes, allowing them to be garbage collected at any point.
Classes are loaded by first attempting to load it via the thread context
ClassLoader(or systemClassLoaderif the calling thread does not have one). If that fails, it will attempt using theClassLoaderthat loadedClassLoaderHelper.If a class or its zero-argument constructor cannot be found, an empty result is returned.
-
-
Constructor Summary
Constructors Constructor Description ConstructorCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Constructor<?>>getConstructor(String className)Retrieve the zero-argument constructor for the given class name.
-
-
-
Method Detail
-
getConstructor
public Optional<Constructor<?>> getConstructor(String className)
Retrieve the zero-argument constructor for the given class name. Returns an empty result if no such constructor is found.
-
-