문제

There is an ejb-jar xml file in our project which defines essentially the same ejb configuration over and over again for a number of different brands. They all share the same underlying code, the same external references etc., so could in fact all be mapped to the same single definition.

The argument is that in future if there is some distinction required between the brands, then the mechanism is in place to manage each pool and configuration separately. This I can accept.

I would however still like to condense this rapidly bloating file. A suggestion floated around was to use XSLT to transform a bespoke xml configuration, but this introduces another type of complexity that I'd like to avoid.

My question then is, does anyone know if the specification supports any means of inheriting some kind of parent or common configuration into the definition of an ejb?

도움이 되었습니까?

해결책

There is no inheritance for EJB component definitions. Some suggestions:

If you're willing to use annotations, you could specify most of your component configuration in the bean class, and then reuse the same <ejb-class/> for multiple <session/>.

If you're using a JavaEE 6 server and you're just trying to cut down on refs, you could consider defining your refs in java:module/env, and then they will be visible to all beans in the module.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top