On Aug 7, 2010, at 10:41 PM, David Jencks wrote: > I've been working on geronimo's ejb lite support. The way geronimo is set up > we tell DeploymentLoader to look in META-INF or WEB-INF for ejb-jar.xml, and > expect openejb to decide that any module that it finds ejbs in, whether by > finding an ejb-jar.xml or by finding annotated classes, is an ejb module. > > Right now openejb is deciding that a module is an ejb module if it has an > ejb-jar.xml, but a web module if it has a web.xml but no ejb-jar.xml, even if > there are annotated ejbs. > > I don't understand why this would be appropriate for openejb, so what I'm > provisionally implementing is: > > - provide a flag in a constructor, preferEjb > - if its true, check for ejb-jar.xml and annotated ejbs before looking for > web.xml, and if found decide the module is an ejb module > - if its is false, the current behavior, where we check for ejb-jar.xml, then > web.xml, then annotated ejbs. > > If the preferEjb=true behavior would be more appropriate for openejb by > itself, let me know and I'll adjust the code appropriately.
Using the discoverModuleType is probably not appropriate for this setup. In fact using the DeploymentLoader at all probably doesn't fit. The rules more or less allow us to skip that: 1. if the web.xml metadata complete flag is true and there is no WEB-INF/ejb-jar.xml == not a web module with ejbs 2. else, we must be prepared to deploy ejbs Probably what we need to do is create an EjbModule object to mirror every WebModule (or the equivalent Geronimo object) if #1 is not the case. The critical part will be setting the AbstractFinder object to be the same one as the WebModule finder and filling in the altDD information. It's actually pretty close to the way we do things now with creating an OpenEJB EjbModule object to match the Geronimo EjbModule object. Thoughts? -David
