Helper class for manually maintaining CDI created instances
which are not managed by the CDI container.
Be aware that instances created that way are
not
managed by the CDI container and thus need to be
cleaned up manually to not create memory leaks!.
Normal code shall use
javax.enterprise.inject.Instance
if possible.
The reason for using UnmanagedInstance is for
@Dependent scoped instances which should not pollute the
CreationalContext
of the containing instance.
Note that the methods of UnmanagedInstance needs to be called
in a well defined order.
Please note that this classes are not thread safe!