@Beta public final class RecursiveObjectLeaker extends Object
If it is not, it will push itself to the stack as unresolved and invoke the constructor. The constructor's lowermost class calls to this class and if the topmost entry is not resolved, it will leak itself.
Upon return from the constructor, the topmost entry is removed and if the queue is empty, the thread-local variable will be cleaned up.
WARNING: BE CAREFUL WHEN USING THIS CLASS. IT LEAKS OBJECTS WHICH ARE NOT COMPLETELY INITIALIZED.
WARNING: THIS CLASS LEAVES THREAD-LOCAL RESIDUE. MAKE SURE IT IS OKAY OR CALL cleanup()
IN APPROPRIATE
PLACES.
THIS CLASS IS EXTREMELY DANGEROUS (okay, not as much as sun.misc.unsafe). YOU HAVE BEEN WARNED. IF SOMETHING BREAKS IT IS PROBABLY YOUR FAULT AND YOU ARE ON YOUR OWN.
Modifier and Type | Method and Description |
---|---|
static void |
afterConstructor(Object key) |
static void |
beforeConstructor(Object key) |
static void |
cleanup() |
static void |
inConstructor(Object obj) |
static <T> T |
lookup(Object key,
Class<T> requiredClass) |
Copyright © 2020 OpenDaylight. All rights reserved.