public class TemporaryReferenceKeeper extends Object
To prevent usage of background threads, users of this class must call cleanReferenceCache() to trigger
the clean up.
| Constructor and Description |
|---|
TemporaryReferenceKeeper(Supplier<Date> currentDateSupplier)
Initializes an instance with all its dependencies.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanReferenceCache()
Checks and cleans cached references that have timed out.
|
void |
keepReferenceTo(Object object)
Keeps a hard reference to the passed object for 1 minute.
|
public void keepReferenceTo(Object object)
When using this method you must call cleanReferenceCache() to trigger a clean up.
object - The object to keep a hard reference to.public void cleanReferenceCache()
Copyright © 2016 Saxonia Systems AG. All Rights Reserved.