Package org.jboss.weld.inject
Interface WeldInstance.Handler<T>
- Type Parameters:
T- the required bean type
- All Superinterfaces:
AutoCloseable,jakarta.enterprise.inject.Instance.Handle<T>
- Enclosing interface:
- WeldInstance<T>
@Deprecated
public static interface WeldInstance.Handler<T>
extends jakarta.enterprise.inject.Instance.Handle<T>
Deprecated.
This interface is deprecated.
CDI 4.0 introduced
Instance.Handle interface that offers the same functionality and can be used in place
of Weld specific WeldInstance.Handler.
This interface represents a contextual reference handler.
Allows to inspect the metadata of the relevant bean and also to destroy the underlying contextual instance.
- Author:
- Martin Kouba
-
Method Summary
-
Method Details
-
get
T get()Deprecated.The contextual reference is obtained lazily, i.e. when first needed.- Specified by:
getin interfacejakarta.enterprise.inject.Instance.Handle<T>- Returns:
- the contextual reference
- Throws:
IllegalStateException- If the producingWeldInstancedoes not exist- See Also:
-
Provider.get()
-
getBean
jakarta.enterprise.inject.spi.Bean<T> getBean()Deprecated.- Specified by:
getBeanin interfacejakarta.enterprise.inject.Instance.Handle<T>- Returns:
- the bean metadata
-
destroy
void destroy()Deprecated.Destroy the contextual instance. It's a no-op if:- called multiple times
- if the producing
WeldInstancedoes not exist - if the handler does not hold a contextual reference, i.e.
get()was never called
- Specified by:
destroyin interfacejakarta.enterprise.inject.Instance.Handle<T>- See Also:
-
Instance.destroy(Object)
-
close
void close()Deprecated.Delegates todestroy().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacejakarta.enterprise.inject.Instance.Handle<T>
-