Module jakarta.cdi
Interface SyntheticBeanCreator<T>
-
- Type Parameters:
T- the bean class of the synthetic bean
public interface SyntheticBeanCreator<T>Creation function for a synthetic bean defined bySyntheticBeanBuilder. CDI container will create an instance of the creation function every time when it needs to obtain an instance of the synthetic bean. Implementations must bepublicclasses with apubliczero-parameter constructor; they must not be beans.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tcreate(Instance<java.lang.Object> lookup, Parameters params)Creates an instance of the synthetic bean.
-
-
-
Method Detail
-
create
T create(Instance<java.lang.Object> lookup, Parameters params)
Creates an instance of the synthetic bean. May only returnnullif the synthetic bean is@Dependent.The
Instanceparameter may be used to simulate producer method parameter injection. However,@Dependentbean instances obtained from theInstanceduring execution remain managed until the synthetic bean instance is destroyed. Therefore, implementations are encouraged to destroy unneeded@Dependentbean instances obtained from theInstance.If the synthetic bean is
@Dependent, theInjectionPointto which it is injected may be looked up from theInstanceparameter.The parameter map contains the same values that were passed to the
SyntheticBeanBuilderthat defined the synthetic bean.- Parameters:
lookup- anInstancethat can be used to lookup other beans, nevernullparams- the parameter map, nevernull- Returns:
- an instance of the bean, may only be
nullif the synthetic bean is@Dependent
-
-