[cdi-dev] [JBoss JIRA] (CDI-654) Revisit BeanConfigurator create/destroy methods

Martin Kouba (JIRA) issues at jboss.org
Thu Nov 24 09:07:00 EST 2016


Martin Kouba created CDI-654:
--------------------------------

             Summary: Revisit BeanConfigurator create/destroy methods
                 Key: CDI-654
                 URL: https://issues.jboss.org/browse/CDI-654
             Project: CDI Specification Issues
          Issue Type: Clarification
            Reporter: Martin Kouba
            Assignee: Martin Kouba
             Fix For: 2.0 .Final


Right now, there are four methods to create/producer bean instance and two methods to destroy/dispose bean instance:
*  {{createWith(Function<CreationalContext<U>, U> callback)}}
* {{<U extends T> BeanConfigurator<U> produceWith(Supplier<U> callback)}}
* {{<U extends T> BeanConfigurator<U> produceWith(Function<Instance<Object>, U> callback)}}
* {{<U extends T> BeanConfigurator<U> producing(U instance)}}
* {{destroyWith(BiConsumer<T, CreationalContext<T>> callback)}}
* {{disposeWith(Consumer<T> callback)}}

I think we should:
* remove {{producing()}} and {{produceWith(Supplier<U> callback)}} methods
* clarify that {{Instance<Object>}} is used to "simulate" producer method injection points and behaves in the same way
* modify {{disposeWith(Consumer<T> callback)}} to {{disposeWith(BiConsumer<T, Instance<Object>> callback)}} so that it's possible to "simulate" disposer method injection points




--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the cdi-dev mailing list