T - the bean class of the synthetic beanpublic interface SyntheticBeanDisposer<T>
SyntheticBeanBuilder.
CDI container will create an instance of the destruction function every time when it needs
to destroy an instance of the synthetic bean. Implementations must be public
classes with a public zero-parameter constructor; they must not be beans.| Modifier and Type | Method and Description |
|---|---|
void |
dispose(T instance,
Instance<java.lang.Object> lookup,
Parameters params)
Destroys an instance of the synthetic bean.
|
void dispose(T instance, Instance<java.lang.Object> lookup, Parameters params)
The Instance parameter may be used to simulate disposer method parameter injection.
All @Dependent bean instances obtained from the Instance during execution
are destroyed when execution completes.
Trying to look up InjectionPoint from the Instance parameter is invalid.
The parameter map contains the same values that were passed to the SyntheticBeanBuilder
that defined the synthetic bean.
instance - the synthetic bean instance, never nulllookup - an Instance that can be used to lookup other beans, never nullparams - the parameter map, never null