On Wed, 13 Feb 2002, Holger Engels wrote: > > If I got it right, the following happens during deployment of an ear: > > 1. the MainDeployer unpacks the ear and iterates over the modules > 2. the MainDeployer retrieves an apropriate deployer for each module > (e.g. EJBDeployer) and invokes the method "deploy" on it > 3. The EJBDeployer creates an Application for its ejb-jar and _starts_ it! > 4. The Application initializes, _creates_ and starts a Container for every > bean > 5. The create Method invokes setupEnvironment > 6. during setupEnvironment the ejb-links are resolved getApplication(). > > So there's one Application per ejb-jar, instead of one Application per > ear. That's a problem: > > If the ear contained two ejb-jars and an ejb from the first jar > "ejb-ref"-links an ejb from the second jar, the link cannot be resolved: > > getApplication().getContainer(ref.getLink()) > > .. will fail, because the two beans are in different applications. If I'm > right, the EJBDeployer should not instantiate a separate Application for > each ejb-jar, but share one Application instance per ear-File. > > If that's not possible, the Applications could be arranged hierarchically. > All ejb-jar Applications from one ear have one ear Application as parent. > Anyway, there must be a unit, that maps all ejb-names from all modules of > an ear to the appropriate Containers. >
Ok, I found out, that the DeploymentInfos are arranged hierarchically and a DeploymentInfo has a public 'shortName'. So it's possible to find all ejb-jar DeploymentInfos, that belong to one ear DeploymentInfo. But that's of no help for the Container .. The shortName can be used as the first part of a "full quallified ejb-name", as described in ejb-spec-2_0, chapter 20.3.2: <ejb-jar-name>#<bean-name> The second part of the name is the name of the Container in the Application. To resolve an ejb-name in an ear, we need a containment unit at the level of the ear. The same way, a Container belongs to an Application, an Application might belong to an "ApplicationBundle". Alternatively, we could parent all Containers of all ejb-jars of one ear with one Application instance. I'd prefer the latter, because at runtime, there's no need to distinguish between the origins of the different ejbs. That's only a matter of assembly and ease of deployment. The keys of the map "containers" should be full qualified ejb-names then and if you lookup a plain ejb-name (only second part), you have to iterate through the keys. The EJBDeployer must not start the Application, this task remains to the deploySubPackages method in the MainDeployer. In the Container, the: setupEnvironment(); -call has to be moved to the beginning of the start method, instead of the end of the create method. Holger _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
