[jboss-dev-forums] [Design of EJB 3.0] - Add

ALRubinger do-not-reply at jboss.com
Thu Nov 22 06:15:45 EST 2007


Placed an ugly line in the other day:

catch(Exception e)
  | {
  |    if(e.getClass().getAnnotation(ApplicationException.class)!=null)
  | {
  |   ...handle AppException
  | } else {
  |    ...handle Exception as normal
  | }

This doesn't account for a couple things:

1) XML-defined ApplicationExceptions in ejb-jar.xml assembly-descriptor/application-exceptions
2) Inheritance (is an exception whose parent is @ApplicationException also an Application Exception?)

Would propose adding a List of Application Exceptions to EJBContainer, which I think would entail:

1) An additional method in Ejb3DescriptorHandler, "addApplicationExceptionAnnotations", to be called from addAssemblyAnnotations().
2) Additional scanning for @ApplicationException at deployment time. 

Tricky thing here is that Application Exceptions are global per deployment unit (JAR), and would need to be referenced from all EJBs (Containers) in that unit.

Or is the matadata project making some of this moot by merging the annotations and XML together into JBossAssemblyDescriptorMetaData, in which case we can skip the scanning step 2) above?

S,
ALR



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107047#4107047

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107047



More information about the jboss-dev-forums mailing list