I think that seam-xml needs to ability to programatically add resource (and other)
producer fields. My proposed syntax is:
<s:EntityManager>
<s:producerField/>
<s:PersistenceContext unitName="customer" />
<my:CustomerDatasource/>
</s:EntityManager>
which would be equivalent to:
@Produces
@PersistenceContext(unitName="main")
@CustomerDatasource
EntityManager entityManager;
This will also support other types of producer fields, such as weld extension generic bean
producer fields and primitives:
<s:String>
<s:producerField/>
<my:ApplicationVersion />
<s:value>3.0.0.GA</s:value>
</s:String>
What does everyone think? I think there is a definite use case for this, but I am not 100%
sure about the syntax.
Stuart