public final class CleanerServiceLocator extends Object
ByteBufferCleanerService implementation.
This class employs the ServiceLoader mechanism to dynamically locate and instantiate an implementation of the ByteBufferCleanerService interface. It selects the most suitable implementation based on the impact level and the Java major version compatibility.
If no suitable service provider is found, it falls back to a reflection-based cleaner service.
This class is thread-safe and ensures that only a single instance of ByteBufferCleanerService is created and shared among all callers.
| Modifier and Type | Method and Description |
|---|---|
static ByteBufferCleanerService |
cleanerService()
Returns a singleton instance of
ByteBufferCleanerService. |
public static ByteBufferCleanerService cleanerService()
ByteBufferCleanerService.
This method uses the ServiceLoader mechanism to dynamically locate and instantiate an implementation of the ByteBufferCleanerService interface. If no suitable service provider is found, it falls back to a reflection-based cleaner service.
Copyright © 2024. All rights reserved.