[jboss-dev-forums] [Design of POJO Server] - Re: Java EE inter-module accessibility for Web Beans

pete.muir@jboss.org do-not-reply at jboss.com
Mon Jul 27 12:49:11 EDT 2009


"alesj" wrote : I've implemented an initial version of this - it's commited in the WB-ri-int trunk.
  | 
  | But thinking about it, the Deployment API seems wrong or useless. :-)

Remember that what the EE spec(s) provide are accessibility rules for classes, not a classloading structure. It's possible to implement the rules in fairly flat, simple fashion, as JBoss does. It would also be possible to produce a much more rigid, hierarchical structure that implements the rules. WB is the RI of 299, so needs to support any impl of the rules.

But let's take another case entirely - an OSGi container - here there are some complex rules based on imports that define what classes are and aren't accessible, and this structure needs to be able to represent this too.

anonymous wrote : (a) why "List of BDAs" or what determines the order

What order? Order isn't particularly important, CDI supports multiple beans that resolve to the same type/binding. It narrows these down itself.

I guess I can add some note to the API that the returned list should be ordered in the way the CL would read archives for classloading.

anonymous wrote : (b) "Circular dependencies will be detected and ignored by the container"

It's quite easy to define a circular accessibility structure such as:

ejb-jar1.jar defines it can access ejb-jar2.jar, and ejb-jar2.jar defines it can access ejb-jar1.jar. In this case you would add ejb-jar1.jar to the BDA list for ejb-jar2.jar, and ejb-jar2.jar to the BDA list for ejb-jar1.jar.

anonymous wrote : I though the whole point of having BeanDeploymentArchive was to be able to get all accessible BDA's.
  | e.g. one jar in ear sees all other jars, but doesn't see war's classes/ and lib/*.jar
  | 
  | Currently I just map the hierarchy/structure,
  | but this seems pretty much the same as existing flat Deployment.

Yes it is - and tbh I didn't expect much more complex for JBoss AS as it uses a very flat classloading structure.

Things I want to check we support:

*  using an ejb-jar not deployed inside the app, but deployed at the top level
*  using extensions defined in manifest.mf http://java.sun.com/javase/6/docs/technotes/guides/jar/jar.html#Main%20Attributes[/url] and [url]http://java.sun.com/javase/6/docs/technotes/guides/extensions/spec.html



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

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



More information about the jboss-dev-forums mailing list