javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

Allow deployment descriptor to list EJB instances without having to be metadata-complete #110

Open glassfishrobot opened 10 years ago

glassfishrobot commented 10 years ago

It would be very useful in large applications to be able to constrain the deployment of EJBs within a third-party supplied EJB jar by means of a deployment descriptor without also having to fully specify all the metadata for each EJB instance in that jar.

Suppose the jar has two EJBs in it, configured with annotations. Suppose further that without deep research I don't know what—say—their default TransactionAttributeType settings are.

Finally, suppose that I wish to include this EJB jar in an .ear file, but only want to have the EJB container deploy one of the beans.

It would be nice if I could use the existing alt-dd functionality to point to an ejb-jar.xml file that simply lists the session bean I want to deploy without specifying any further information. To my knowledge, this is impossible with the current specification, as there is no way to prevent EJB discovery without also marking the deployment descriptor as metadata-complete.

glassfishrobot commented 10 years ago

Reported by @ljnelson

glassfishrobot commented 10 years ago

@ljnelson said: Table 25 in the EJB 3.1 specification specifies explicitly that when a 3.1 ejb-jar.xml deployment descriptor is found that is not metadata-complete then annotations must be processed. I would like to find a way—effectively—to augment the element such that additional EJBs are not defined by annotation processing, but otherwise everything works as it currently does in EJB 3.1. Specifically, the beans listed in should of course be processed for annotations if the deployment descriptor is not metadata-complete.

As an initial idea, we could adapt a similar concept from JPA's META-INF/persistence.xml:

<enterprise-beans>
  <exclude-unlisted-enterprise-beans>true</exclude-unlisted-enterprise-beans>
  <session> <!-- and so on --> </session>
</enterprise-beans>
glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA EJB_SPEC-110