Top Description Methods
javax.enterprise.inject.spi.configurator

public Interface ProducerConfigurator<T>

Type Parameters
<T>
The return type of the producer method or the type of the producer field
Imports
java.util.function.Consumer, .Function, javax.enterprise.context.spi.CreationalContext, javax.enterprise.inject.spi.ProcessProducer, .Producer

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.

Author
Martin Kouba
Since
2.0
See Also
ProcessProducer#configureProducer()

Method Summary

Modifier and TypeMethod and Description
public ProducerConfigurator<T>

Returns:

self
disposeWith
(Consumer<T>
a Consumer defining the callback to set
callback
)

Set a callback to destroy the produced instance.

public <U extends T> ProducerConfigurator<T>

Returns:

self
produceWith
(Function<CreationalContext<U>, U>
a Function defining the callback to set
callback
)

Set a callback to produce a new instance.

Method Detail

disposeWithback to summary
public ProducerConfigurator<T> disposeWith(Consumer<T> callback)

Set a callback to destroy the produced instance.

Parameters
callback:Consumer<T>

a Consumer defining the callback to set

Returns:ProducerConfigurator<T>

self

See Also
Producer#dispose(Object)
produceWithback to summary
public <U extends T> ProducerConfigurator<T> produceWith(Function<CreationalContext<U>, U> callback)

Set a callback to produce a new instance.

Parameters
callback:Function<CreationalContext<U>, U>

a Function defining the callback to set

Returns:ProducerConfigurator<T>

self

See Also
Producer#produce(CreationalContext)