-
- Type Parameters:
T- the required bean type
- All Superinterfaces:
java.lang.AutoCloseable
public static interface Instance.Handle<T> extends java.lang.AutoCloseableThis interface represents a contextual reference handle.Allows to inspect the metadata of the relevant bean before resolving its contextual reference and also to destroy the underlying contextual instance.
- Author:
- Matej Novotny
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Delegates todestroy().voiddestroy()Destroy the contextual instance.Tget()The contextual reference is obtained lazily, i.e.Bean<T>getBean()
-
-
-
Method Detail
-
get
T get()
The contextual reference is obtained lazily, i.e. when first needed.- Returns:
- the contextual reference
- Throws:
java.lang.IllegalStateException- If the producingInstancedoes not existjava.lang.IllegalStateException- If invoked onInstance.Handlethat previously successfully destroyed its underlying contextual reference- See Also:
Provider.get()
-
destroy
void destroy()
Destroy the contextual instance. It's a no-op if:- See Also:
Instance.destroy(Object)
-
close
void close()
Delegates todestroy().- Specified by:
closein interfacejava.lang.AutoCloseable
-
-