From line 0 changed to line 0:
Work in progress list of enhancements to |javax.enterprise.inject.spi| for the CDI 1.0 maintenance release.
Work in progress list of enhancements to |javax.enterprise.inject.spi| for the CDI 1.0 maintenance release and CDI 1.1.
From line 2 changed to line 2:
++ Ability to wrap the |InjectionPoint|
++ Producer field initializers
From line 4 changed to line 4:
Add |ProcessInjectionPoint| event.
This is a generalization of CDI's built-in support for Java EE component environment "resources", allowing portable extensions to define their own annotations that work like |@Resource|, |@PersistenceContext|, |@EJB| and friends in a producer field declaration. For example:
From line 6 changed to lines 6 to 7:
Also add |BeanManager.createInjectionPoint(...)| passing the member and all attributes.
`@Produces @JMS(topic=".../prices")
@Prices Topic topic;`
From line 8 changed to line 9:
++ Ability to process alternatives, interceptors and deocrators of a module
We would need to introduce a new interface in the SPI package:
From lines 10 to 12 changed to lines 11 to 13:
Add |Module| object with |getAlternatives()|, |getInterceptors()| and |getDecorators()|
Add |ProcessModule| event.
Add |BeanManager.getModule()|.
`public interface Initializer<X> {
public X getInitialValue(AnnotatedField<?> field);
}`
From line 14 changed to line 15:
++ Ability to obtain a container-created bean for a |Producer| or |InjectionTarget|
Along with a |ProcessProducerField| event type extending |ProcessProducer| with a |setInitializer()| method.
From line 16 changed to line 17:
A convenience feature to minimize the number of anonymous classes implementing |Bean|.
++ Ability to obtain a container-created bean for a |Producer| or |InjectionTarget| or for an |AnnotatedType|
From line 18 added to lines 19 to 20:
A convenience feature to minimize the number of anonymous classes implementing |Bean| and minimize implementation errors.
From line 31 changed to line 34:
++ Ability to override attributes of a |Bean|.
Also add:
From line 33 changed to lines 36 to 76:
Either from |ProcessBean| event, or, better from a |ProcessBeanAttributes| event which lets you wrap the |BeanAttributes|.
= |createBean(AnnotatedType at)|
to |BeanManager|.
++ Ability to override attributes of a |Bean|
Wrapping the |AnnotatedType| just to add an annotation is a real PITA.
We should make it possible to mess with the scope/qualifiers/name/etc of a bean either from |ProcessBean| event, or, better from a |ProcessBeanAttributes| event which lets you wrap the |BeanAttributes| or give the container a new one created with |BeanManager.createBeanAttributes()|.
++ Ability to process modules
Add |ProcessModule| event which let's you mess with the enabled alternatives/interceptors/decorators and more:
`public interface ProcessModule {
public Set<Class> getAlternatives();
public List<Class> getInterceptors();
public List<Class> getDecorators();
public Set<AnnotatedType> getAnnotatedTypes();
public Set<Extension> getExtensions();
}`
++ Ability to wrap the |InjectionPoint|
Add |ProcessInjectionPoint| event, along with |BeanManager.createInjectionPoint(annotatedMember)|.
++ Allow injection of |Instance<X>| into portable extensions
It's more convenient for a portable extension to use |Instance| than |BeanManager.getBeans()| followed by |BeanManager.getInstance()|.
++ Clarify that there can be multiple |AnnotatedType| instances per Java class
This is not 100% clear in the spec.
++ Obtain |Extension| instances from |BeanManager|
Add |public <T extends Extension> T getExtension(Class<T> extensionClass)| to |BeanManager|.
++ Use |Module| object, instead of |Class| for inter-module dependency resolution
We should add |Module| and |Bean.getModule()| instead of using |getBeanClass()| as a proxy for the module when doing inter-module dependency resolution.