-
1. Re: Understanding seam initialization
keithnaas Mar 14, 2008 4:38 PM (in response to lightguard)As with many other web application frameworks, its all kicked off at deploy time by a listener as shown in this tutorial.
If you'd like to see the code, look at SeamListener. The class javadoc for SeamListener:
/** * Drives certain Seam functionality such as initialization and cleanup * of application and session contexts from the web application lifecycle. * * @author Gavin King */
That guy kicks off the Initialization class which magically scans for all of the various configuration files.
This method illustrates what is happening pretty clearly:
public Initialization create() { deploymentStrategy = new StandardDeploymentStrategy(Thread.currentThread().getContextClassLoader()); deploymentStrategy.scan(); addNamespaces(); initComponentsFromXmlDocument("/WEB-INF/components.xml"); initComponentsFromXmlDocument("/WEB-INF/events.xml"); //deprecated initComponentsFromXmlDocuments(); initPropertiesFromServletContext(); initPropertiesFromResource(); initJndiProperties(); return this; }
-
2. Re: Understanding seam initialization
lightguard Mar 14, 2008 6:42 PM (in response to lightguard)So it's the war that actually starts Seam? How does it pick up the ejbs in the ear if it's being started in the war? Wouldn't the classloader that the listener is finding be the war classloader?
-
3. Re: Understanding seam initialization
pmuir Mar 14, 2008 7:08 PM (in response to lightguard)Print out the hierarchy for the war classloader and youy will see the EAR classloader is the parent. In fact, IIRC EE specifies this.
-
4. Re: Understanding seam initialization
lightguard Mar 24, 2008 8:29 PM (in response to lightguard)With seam being loaded via the war, is there a problem having multiple web-apps in the same ear that are seam apps?