Interface ProducerConfigurator<T>
-
- Type Parameters:
T
- The return type of the producer method or the type of the producer field
public interface ProducerConfigurator<T>
A
ProducerConfigurator
can configure aProducer
. 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.
- Since:
- 2.0
- Author:
- Martin Kouba
- See Also:
ProcessProducer.configureProducer()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProducerConfigurator<T>
disposeWith(Consumer<T> callback)
Set a callback to destroy the produced instance.<U extends T>
ProducerConfigurator<T>produceWith(Function<CreationalContext<U>,U> callback)
Set a callback to produce a new instance.
-
-
-
Method Detail
-
produceWith
<U extends T> ProducerConfigurator<T> produceWith(Function<CreationalContext<U>,U> callback)
Set a callback to produce a new instance.- Type Parameters:
U
- instance type- Parameters:
callback
- aFunction
defining the callback to set- Returns:
- self
- See Also:
Producer.produce(CreationalContext)
-
disposeWith
ProducerConfigurator<T> disposeWith(Consumer<T> callback)
Set a callback to destroy the produced instance.- Parameters:
callback
- aConsumer
defining the callback to set- Returns:
- self
- See Also:
Producer.dispose(Object)
-
-