Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 28671 invoked from network); 30 Mar 2010 01:44:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Mar 2010 01:44:00 -0000 Received: (qmail 98546 invoked by uid 500); 30 Mar 2010 01:44:00 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 98496 invoked by uid 500); 30 Mar 2010 01:44:00 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 98489 invoked by uid 99); 30 Mar 2010 01:44:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Mar 2010 01:44:00 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=AWL,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of david.blevins@visi.com designates 208.42.176.213 as permitted sender) Received: from [208.42.176.213] (HELO g2host.com) (208.42.176.213) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Mar 2010 01:43:53 +0000 Received: from [71.106.90.161] (account dblevins@visi.com HELO [192.168.42.5]) by mailfront2.g2host.com (CommuniGate Pro SMTP 5.1.16) with ESMTPSA id 145609726 for dev@geronimo.apache.org; Mon, 29 Mar 2010 20:43:30 -0500 Message-Id: From: David Blevins To: dev@geronimo.apache.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Webapp Annotation processing for 299 Date: Mon, 29 Mar 2010 18:43:18 -0700 References: <02C0B7E8-16D2-470F-A077-558563E77222@visi.com> <4A8D2F3C.6090902@gmail.com> <4A8D5889.1080701@gmail.com> X-Mailer: Apple Mail (2.936) Bringing this thread up again as it is still a major TODO and if someone is looking for something to work on, it's a very good place. On Aug 21, 2009, at 8:16 PM, David Blevins wrote: > Great summary, thanks! > > So as I mentioned on the OpenEJB list and the reason I kicked the > thread over here is that the ServletContextListener approach to > scanning doesn't work as none of those things exist at deploy time. > > To try and move things forward I've created a basic plugin for > OpenWebBeans that can serve as a starting point for the > integration. This will help get us out of the abstract and right > down to the nuts and bolts. > > DEPLOYMENT > > Long story short, the code that scans the managed bean classes for > @Resource etc. goes here: > > http://svn.apache.org/repos/asf/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java > > The code to do the @Resource scanning is actually in there already, > it's the line like this: > namingBuilders.buildNaming(webApp, jettyWebApp, webModule, > buildingContext); > What needs to happen in this class is we need to get a complete list > of the managed bean classes so they can be scanned by the Geronimo > naming builder. This class is an extension to the Geronimo > deployment system, so no webapp objects exist yet. I know that the > OpenWebBeans code doesn't currently work like this and relies on > ServetContext and other things. We will have to find a way to get > that to work without the use of any servet APIs. > > A bonus is that you can install any servlets or filters or listeners > you like into the webapp so when it boots, anything you'd like to > add will be there without the user having to add it. A pretty cool > advantage to being part of the deployment system. I've got some > code in there that adds a ServletContextListener -- I left the > classname of the listener blank, you just need to fill it in. > > For a great example of what the JSF deployer extension looks like, > see this class: > > https://svn.apache.org/repos/asf/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java > > > RUNTIME > > Here's where you can add any startup and shutdown code you'd like: > > http://svn.apache.org/repos/asf/geronimo/server/trunk/plugins/openwebbeans/geronimo-openwebbeans/src/main/java/org/apache/geronimo/openwebbeans/OpenWebBeansGBean.java > > This will be guaranteed to run just before the webapp starts up and > stop just after the webapp stops. Great place for initialization > code and taking care of getting any hooks into Geronimo that you > might need/want for while the webapp is running. > > This doesn't tackle everything on the TODO list but is a step in the > right direction. > > -David > > On Aug 20, 2009, at 8:01 AM, Gurkan Erdogdu wrote: > >> I want to give brief introduction about current implementation in >> the view of integration points >> >> Brief Summary About Current Situation >> --------------------------------------------------------- >> Currently we bootstrap OpenWebBeans via ServletContextListener. It >> supports following containers >> >> - Java Web Containers like Jetty, Tomcat etc. >> - Tomcat Embeddable OpenEJB Container >> >> If developer wants to use OWB functionality in his application, it >> has to configure its "web.xml" to include some OWB specific >> classes. For EJB functionality, we use embeddable Tomcat OpenEJB >> container. To use EJB functionality, developer must annotate their >> EJB classes with OWB specific "Interceptor" class. >> >> How OWB Boots Currently(From integration point of view) >> ------------------------------------------------------- >> 1* Web Container calls OWB specific context listener's "application >> started" method >> 2* OWB container scans related classes from the artifacts (if META- >> INF/beans.xml, or WEB-INF/beans.xml exists. beans.xml is a marker >> for deployment) >> 3* If developer configures OWB to use EJB functionality, for each >> scanned class, it asks OpenEJB to learn whether it is an EJB class >> or not (Using EJB Plugin that is written accroding to the OpenEJB) >> 4* If it is an EJB class, it creates EJB bean and register it with >> the OWB container otherwise if it is a Java EE defined Managed Bean >> Class, it creates a "Managed Bean" and register it with the OWB >> container. >> >> Developer Responsibility to Use OWB >> -------------------------------------------------------- >> 1* Add servlet context listener to his web module's "web.xml" >> 2* Annotate EJB classes with OWB interceptor >> 3* Configure OWB container to use EJB functionality >> 4* Configure some OWB specific parameters (For example : if use JMS >> injections, specify ConnectionFactory JNDI name) >> >> Current Problems >> ----------------------------------------------------- >> 1* Currently we just support "WAR" module with embeddable EJB. >> 2* Developer requires to update WAR/EJB module metadata files to >> use OWB. >> 3* Standalone EJB JAR,RAR, EAR not supported >> 4* Injections into "Managed Beans" class not well supported. (For >> example : @Resource, @WebServiceRef, @EJB, >> @PersistenceUnit,@PersistenceContext.) >> >> How Could We Integrate with Geronimo >> --------------------------------------------------------- >> 1* Geronimo looks for deployment. If it contains "beans.xml", it >> automatically registers OWB servlet context listener with WAR's >> web.xml at deployment time >> 2* Automatically registers OWB EJB interceptor with EJBs at >> deployment time (If module is EJB module or EAR module containing >> EJB modules) >> 3* Support EJB JAR, EAR, RAR modules >> 4* Write EJB Plugin for Geronimo >> 5* Supports injections for Managed Beans >> >> I hope this helps a bit more >> >> Thanks; >> >> --Gurkan >> >> 2009/8/20 Rick McGuire >> Gurkan Erdogdu wrote: >> >>>We'd be interested in any details about what integration work >> might be needed to add this to Geronimo. >> It is a really fascinating thing that you support us to finish >> implementation and pass TCK :) We really need a help. >> I think there is a great willingness to help you with this, but I >> was looking form something more specific, such as the actual areas/ >> functions where integration assistance is needed. >> Rick >> >> >> Thanks; >> >> --Gurkan >> >> 2009/8/20 Rick McGuire > >> >> >> Gurkan Erdogdu wrote: >> >> Hi; >> >> Thanks for kicking discussion David. >> >> As you may already know Java EE 6 will be planned to release >> on November. Do you have any plan or roadmap to integrate >> JSR-299 with Geronimo? >> >> We have a tentative roadmap for implementing the Web Profile at: >> >> http://cwiki.apache.org/confluence/display/GMOxDEV/Road+map+for+JEE6+Web+Profile >> >> For the JEE6 plans, the web profile did not include JSR 299, which >> I guess has changed recently. We'd be interested in any details >> about what integration work might be needed to add this to >> Geronimo. >> Rick >> >> >> We are working hard to implement full specification but it has >> some parts that requires to integrate with Java EE server >> tightly. >> >> Thanks; >> >> --Gurkan >> >> 2009/8/20 David Blevins > > >> >> >> >> >> I've been talking with Gurkan of OpenWebBeans over on the >> OpenEJB >> list and it seemed like a good idea to kick the thread over >> here >> as well. >> >> The long and short of it is that we'll need to scan 299 >> managed >> beans at deploy time exactly as we do for JSF. >> >> Wanted to point him at the JSF scanning code, but can't >> remember >> the details. Anyone remember? An svn link is fine. >> >> >> -David >> >> >> >> >> >> >> -- Gurkan Erdogdu >> http://gurkanerdogdu.blogspot.com >> >> >> >> >> >> -- >> Gurkan Erdogdu >> http://gurkanerdogdu.blogspot.com >> >> >> >> >> -- >> Gurkan Erdogdu >> http://gurkanerdogdu.blogspot.com > >