T
- The return type of the producer method or the type of the producer fieldpublic interface ProducerConfigurator<T>
A ProducerConfigurator
can configure a Producer
. The container must provide an implementation of this
interface.
This configurator is not thread safe and shall not be used concurrently.
CDI Lite implementations are not required to provide support for Portable Extensions.
ProcessProducer.configureProducer()
Modifier and Type | Method and Description |
---|---|
ProducerConfigurator<T> |
disposeWith(java.util.function.Consumer<T> callback)
Set a callback to destroy the produced instance.
|
<U extends T> |
produceWith(java.util.function.Function<CreationalContext<U>,U> callback)
Set a callback to produce a new instance.
|
<U extends T> ProducerConfigurator<T> produceWith(java.util.function.Function<CreationalContext<U>,U> callback)
U
- instance typecallback
- a Function
defining the callback to setProducer.produce(CreationalContext)
ProducerConfigurator<T> disposeWith(java.util.function.Consumer<T> callback)
callback
- a Consumer
defining the callback to setProducer.dispose(Object)