Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface SyntheticBeanDisposer<T>

Type Parameters
<T>
the bean class of the synthetic bean
Imports
jakarta.enterprise.inject.Instance

Destruction function for a synthetic bean defined by 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.
Since
4.0

Method Summary

Modifier and TypeMethod and Description
public void
dispose(T
the synthetic bean instance, never null
instance
,
Instance<Object>
an Instance that can be used to lookup other beans, never null
lookup
,
Parameters
the parameter map, never null
params
)

Destroys an instance of the synthetic bean.

Method Detail

disposeback to summary
public void dispose(T instance, Instance<Object> lookup, Parameters params)

Destroys an instance of the synthetic bean.

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.

Parameters
instance:T

the synthetic bean instance, never null

lookup:Instance<Object>

an Instance that can be used to lookup other beans, never null

params:Parameters

the parameter map, never null