[cdi-dev] [JBoss JIRA] (CDI-558) Standardize the Meta-Data builders API (BeanBuilder, etc...)

Antoine Sabot-Durand (JIRA) issues at jboss.org
Mon Nov 2 09:34:00 EST 2015


    [ https://issues.jboss.org/browse/CDI-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124307#comment-13124307 ] 

Antoine Sabot-Durand commented on CDI-558:
------------------------------------------

We should do this for all SPI metadata in the spec. That would bring us:

* {{AnnotatedTypeBuilder}}
* {{BeanAttributesBuilder}} (Ancestor of BeanBuilder to be used in ProcessBeanAttributes)
* {{InjectionPointBuilder}}
* {{ObserverMethodBuilder}}

Less sure about:
* {{InjectionTargetBuilder}} (we already have a factory)
* {{ProducerBuilder}} (Factory here as well)

The question is how should we retrieve these builders. I don't think it's a good idea to restrict their access to lifecyle event since we could need them outside an extension.
{{BeanManager}} seems the obvious place but there are already too much method in it.  Perhaps it's time to create an interface for such service method, that the BeanManager would implement and that could be injected as well to provide access to these builders.

WDYT ?

> Standardize the Meta-Data builders API (BeanBuilder, etc...)
> ------------------------------------------------------------
>
>                 Key: CDI-558
>                 URL: https://issues.jboss.org/browse/CDI-558
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Martin Kouba
>             Fix For: 2.0 (discussion)
>
>
> The RI includes an experimental BeanBuilder API (see also http://weld.cdi-spec.org/news/2015/02/25/weld-300Alpha5/#_bean_builder_api for more information). The API is similar to the [API provided by DeltaSpike|http://deltaspike.apache.org/javadoc/1.2.1/org/apache/deltaspike/core/util/bean/BeanBuilder.html] but also includes some improvements (e.g. Java 8 lambdas may be used to simplify the process of registration).
> * BeanBuilder Javadoc: http://docs.jboss.org/weld/javadoc/3.0/weld-api/org/jboss/weld/experimental/BeanBuilder.html
> * ExperimentalAfterBeanDiscovery Javadoc: http://docs.jboss.org/weld/javadoc/3.0/weld-api/org/jboss/weld/experimental/ExperimentalAfterBeanDiscovery.html
> * See also [the test extension for more examples of using this API|https://github.com/weld/core/blob/master/tests-arquillian/src/test/java/org/jboss/weld/tests/extensions/custombeans/BuilderExtension.java]



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list