| |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <HTML> |
| <HEAD> |
| <!-- $PAGETITLE --> |
| <TITLE>OpenEJB - EJB + JPA + JSF + JAX-RS</TITLE> |
| <LINK href="http://openejb.apache.org/all.css" rel="stylesheet" type="text/css"> |
| <!--[if IE]><link rel="stylesheet" type="text/css" media="screen, projection" href="openejb.apache.org/ie.css"><![endif]--> |
| |
| <LINK rel="SHORTCUT ICON" href="http://openejb.apache.org/images/favicon.ico"> |
| <META http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
| </HEAD> |
| <BODY> |
| |
| <!-- Delay the loading of the external javascript file needed for labels (as it takes too long to load and visibly holds loading of the page body) --> |
| <!-- To do this without javascript errors over undefined functions, we need to declare stubs here (that are overrided later by the proper implementations) --> |
| <SCRIPT language="JavaScript" type="text/javascript"> |
| function doAddLabel(hideTextfieldAfterAddParam) |
| { |
| // stub |
| } |
| |
| function onAddLabel() |
| { |
| // stub |
| } |
| |
| function showLabelsInput() |
| { |
| // stub |
| } |
| </SCRIPT> |
| |
| <A name="top"></A> |
| <TABLE class="frameTable" cellpadding="0" cellspacing="0" border="0"> |
| <TR class="Row1"> |
| <TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col2"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col3"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| </TR> |
| <TR class="Row2"> |
| <TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3" id="breadcrumbs"> |
| <!-- $TOP_NAV_BAR --> |
| <A href="../OPENEJB/index.html" title="Index">Home</A> | <A href="../OPENEJB/download.html" title="Download">Download</A> | <A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Lists</A> | <A href="http://issues.apache.org/jira/browse/OPENEJB" class="external-link" rel="nofollow">Issues</A> |
| |
| </TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> </TD> |
| </TR> |
| <TR class="Row3"> |
| <TD class="Col1"><IMG alt="" class="Row3Img" id="thinLine" src="http://openejb.apache.org/images/line_sm.gif"></TD> |
| <TD class="Col2"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col3"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| </TR> |
| <TR class="Row4"> |
| <TD class="Col1"> |
| <SPAN id="Navigation"> |
| |
| <H3><A name="Navigation-Overview"></A>Overview</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/index.html" title="Index">Home</A></LI> |
| <LI><A href="../OPENEJB/news.html" title="News">News</A></LI> |
| <LI><A href="../OPENEJB/faq.html" title="FAQ">FAQ</A></LI> |
| <LI><A href="../OPENEJB/download.html" title="Download">Download</A></LI> |
| <LI><A href="index.html" title="Index">Documentation</A></LI> |
| <LI><A href="../OPENEJB/examples.html" title="Examples">Examples</A></LI> |
| <LI><A href="http://cwiki.apache.org/confluence/display/OPENEJB/Lightening%20Demos" class="external-link" rel="nofollow">Lightning Demos</A></LI> |
| <LI><A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI> |
| <LI><A href="../OPENEJB/source-code.html" title="Source Code">Source Code</A></LI> |
| <LI><A href="http://blogs.apache.org/openejb" class="external-link" rel="nofollow">Project Blog</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Servers"></A>Servers</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/local-server.html" title="Local Server">Local</A></LI> |
| <LI><A href="../OPENEJB/remote-server.html" title="Remote Server">Remote</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Integrations"></A>Integrations</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="tomcat.html" title="Tomcat">Tomcat</A></LI> |
| <LI><A href="../OPENEJB/geronimo.html" title="Geronimo">Geronimo</A></LI> |
| <LI><A href="../OPENEJB/webobjects.html" title="WebObjects">WebObjects</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Community"></A>Community</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/team.html" title="Team">Team</A></LI> |
| <LI><A href="../OPENEJB/articles.html" title="Articles">Articles</A></LI> |
| <LI><A href="http://webchat.freenode.net/?channels=openejb" class="external-link" rel="nofollow">IRC</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-RelatedProjects"></A>Related Projects</H3> |
| |
| <UL class="alternate" type="square"> |
| <LI><A href="http://activemq.apache.org/" class="external-link" rel="nofollow">ActiveMQ</A></LI> |
| <LI><A href="http://openjpa.apache.org/" class="external-link" rel="nofollow">OpenJPA</A></LI> |
| <LI><A href="http://cxf.apache.org/" class="external-link" rel="nofollow">CXF</A></LI> |
| </UL> |
| |
| |
| <H3><A name="Navigation-Index"></A>Index</H3> |
| <UL class="alternate" type="square"> |
| <LI><A href="../OPENEJB/space-index.html" title="Space Index">Site Index</A></LI> |
| <LI><A href="space-index.html" title="Space Index">Doc Index</A></LI> |
| </UL> |
| |
| <H3> |
| <A name="Navigation-Feeds"></A> |
| Feeds |
| </H3> |
| |
| <UL class="feeds"> |
| <LI> |
| <A href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false"> |
| <IMG src="http://openejb.apache.org/images/rss.gif"></A> |
| <A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">Site</A> |
| </LI> |
| |
| <LI><A href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB"> |
| <IMG src="http://openejb.apache.org/images/rss.gif"></A> |
| <A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">News</A> |
| </LI> |
| </UL> |
| </SPAN> |
| </TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3"> |
| <TABLE id="PageHeader" border="0" width="100%"> |
| <TR> |
| <TD> |
| <A href="http://openejb.org/"> |
| <IMG hspace="0" src="http://openejb.apache.org/images/logo_openejb.gif" vspace="0"> |
| </A> |
| </TD> |
| <TD align="right"> |
| <A href="http://www.apache.org/"> |
| <IMG src="http://www.apache.org/images/asf-logo.gif" width="258" height="66"> |
| </A> |
| </TD> |
| </TR> |
| <TR> |
| <TD id="page_title"> |
| <!-- $TITLE --> |
| EJB + JPA + JSF + JAX-RS |
| </TD> |
| |
| <TD align="right"> |
| <BR><BR> |
| <!-- Google CSE Search Box Begins --> |
| <FORM id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse"> |
| <INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90"> |
| <INPUT type="hidden" name="cof" value="FORID:0"> |
| <INPUT name="q" type="text" size="25"> |
| <INPUT type="submit" name="sa" value="Search"> |
| </FORM> |
| <SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT> |
| <!-- Google CSE Search Box Ends --> |
| |
| </TD> |
| </TR> |
| </TABLE> |
| <P> |
| <!-- $BODY --> |
| <DIV id="PageContent"> |
| <H1><A name="EJB%2BJPA%2BJSF%2BJAX-RS-BusinessCase"></A>Business Case</H1> |
| |
| <P>The example explains how a real-life business problem is solved using OpenEJB in a combination with other open-source frameworks and tools. The example covers the entire technical solution, including architecture, design, build automation, unit testing, implementation, and deployment.</P> |
| |
| <P>The product is hosted at <A href="http://oss.rempl.com/" class="external-link" rel="nofollow">http://oss.rempl.com</A> with its source code available at <A href="http://svn.rempl.com/trunk/rempl/rempl-oss" class="external-link" rel="nofollow">http://svn.rempl.com/trunk/rempl/rempl-oss</A>. The purpose of the system is to collect UML meta information from open source products and make it visible for end-users in form of diagrams and texts. More information about the product and its documentation you can get at <A href="http://www.rempl.com/rempl-oss/" class="external-link" rel="nofollow">http://www.rempl.com/rempl-oss/</A>.</P> |
| |
| <H1><A name="EJB%2BJPA%2BJSF%2BJAX-RS-ArchitectureandDesign"></A>Architecture and Design</H1> |
| |
| <P>The following Java-stack technologies are used in the system:</P> |
| |
| <UL> |
| <LI>OpenEJB as an implementation of EJB</LI> |
| <LI>OpenJPA, an implementation of JPA</LI> |
| <LI>Jersey, implementation of JAX-RS</LI> |
| <LI>Mojarra, implementation of Java Server Faces (JSF)</LI> |
| </UL> |
| |
| |
| <P>There are three layers in the system (Presentation, Business, and Persistence) and a number of components in each of them: </P> |
| |
| <P><SPAN class="image-wrap" style=""><IMG src="http://www.rempl.com/rempl-oss/tikz/architecture-components.png" style="border: 0px solid black"></SPAN></P> |
| |
| <P>Presentation Layer includes JSF (Mojarra), JAX-RS (Jersey), and JEE container (Tomcat). In other words, everything on top of "<A href="http://www.rempl.com/rempl-oss/apidocs/com/rempl/oss/delegates/package-summary.html" class="external-link" rel="nofollow">Delegates</A>" in the diagram. Package <A href="http://www.rempl.com/rempl-oss/apidocs/com/rempl/oss/delegates/package-summary.html" class="external-link" rel="nofollow">com.rempl.oss.delegates</A> with its classes realize <A href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html" class="external-link" rel="nofollow">Business Delegate</A> and <A href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/ServiceLocator.html" class="external-link" rel="nofollow">Service Locator</A> JEE design patterns. <EM>More about it later...</EM></P> |
| |
| <P>Business Layer includes EJB (OpenEJB), <A href="http://www.rempl.com/rempl-oss/apidocs/com/rempl/oss/brokers/package-summary.html" class="external-link" rel="nofollow">Brokers</A> (Stateless Session Beans), and JPA entities.</P> |
| |
| <P>Persistence Layer includes JPA (OpenJPA), JDBC (MySQL JDBC Driver) and the MySQL server.</P> |
| |
| <H1><A name="EJB%2BJPA%2BJSF%2BJAX-RS-BuildAutomationandTests"></A>Build Automation and Tests</H1> |
| |
| <P>Build automation is managed by <A href="http://maven.apache.org/ref/3.0/" class="external-link" rel="nofollow">Maven 3</A>, see our <A href="http://trac.fazend.com/rempl/browser/rempl/trunk/rempl/rempl-oss/pom.xml" class="external-link" rel="nofollow">pom.xml</A>.</P> |
| |
| <P>There are four levels of testing in the product:</P> |
| |
| <OL> |
| <LI>Static analysis</LI> |
| <LI>Out-of-container unit testing</LI> |
| <LI>In-container functional testing</LI> |
| <LI>On-location testing</LI> |
| </OL> |
| |
| |
| <P>During static analysis we are using <A href="http://maven.apache.org/plugins/maven-checkstyle-plugin/" class="external-link" rel="nofollow">Checkstyle</A>, <A href="http://maven.apache.org/plugins/maven-pmd-plugin/" class="external-link" rel="nofollow">PMD</A>, <A href="http://mojo.codehaus.org/findbugs-maven-plugin/" class="external-link" rel="nofollow">FindBugs</A>, <A href="http://mojo.codehaus.org/cobertura-maven-plugin/" class="external-link" rel="nofollow">Cobertura</A>, <A href="http://maven.apache.org/plugins/maven-dependency-plugin/analyze-only-mojo.html" class="external-link" rel="nofollow">maven-dependency-plugin</A>, <A href="http://mojo.codehaus.org/xml-maven-plugin/" class="external-link" rel="nofollow">xml-maven-plugin</A>. Important to note that all these tools are used as gate condition checkers, not as post-factum analyzers. </P> |
| |
| <P>Out-of-container tests are automated with JUnit. Good example of a Stateless Session Bean out-of-container testing: <A href="http://trac.fazend.com/rempl/browser/rempl/trunk/rempl/rempl-oss/src/test/java/com/rempl/oss/brokers/UserMgrBeanTest.java" class="external-link" rel="nofollow">UserMgrBeanTest.java</A>.</P> |
| |
| <P>In-containter functional testing is automated with JSFUnit and embedded Tomcat container. <EM>more later...</EM></P> |
| |
| <P><EM>On-location testing is not yet automated... working on it...</EM></P> |
| |
| <H1><A name="EJB%2BJPA%2BJSF%2BJAX-RS-ConfigurationandPlumbing"></A>Configuration and Plumbing</H1> |
| |
| <P>TBD...</P> |
| |
| <H1><A name="EJB%2BJPA%2BJSF%2BJAX-RS-Implementation"></A>Implementation</H1> |
| |
| <P>TBD...</P> |
| </DIV> |
| </P> |
| </TD> |
| <TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> |
| |
| |
| </TD> |
| </TR> |
| <TR class="Row5"> |
| <TD class="Col1"> </TD> |
| <TD class="Col2"> </TD> |
| <TD class="Col3"> |
| <BR> |
| <BR> |
| <IMG width="100%" height="1" src="http://openejb.apache.org/images/line_light.gif"> |
| <TABLE width="100%"> |
| <TR> |
| <TD> |
| <SPAN class="bodyGrey"> |
| <SMALL> |
| <NOTICE><!-- $FOOTER --> |
| Apache OpenEJB is an project of The Apache Software Foundation (ASF) |
| </NOTICE> |
| <BR> |
| Site Powered by |
| <A href="http://atlassian.com/">Atlassian</A> |
| <A href="http://atlassian.com/confluence/">Confluence</A> |
| . |
| </SMALL> |
| </SPAN> |
| </TD> |
| <TD align="right"> |
| <A style="color:#999;font-size:small;font-weight:normal;" href="https://cwiki.apache.org/confluence/pages/editpage.action?spaceKey=OPENEJBx30&title=EJB%20%20%20JPA%20%20%20JSF%20%20%20JAX-RS">[ edit ]</A> |
| </TD> |
| </TR> |
| </TABLE> |
| <BR> |
| </TD> |
| <TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD> |
| <TD class="Col5"> </TD> |
| </TR> |
| </TABLE> |
| |
| <!-- Needed for composition plugin --> |
| <!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content --> |
| <SPAN style="display: none"> |
| <SCRIPT type="text/javascript" language="JavaScript" src="http://cwiki.apache.org/confluence/labels-javascript"></SCRIPT> |
| |
| <SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript"> |
| </SCRIPT> |
| <SCRIPT type="text/javascript"> |
| _uacct = "UA-2717626-1"; |
| urchinTracker(); |
| </SCRIPT> |
| </SPAN> |
| |
| </BODY> |
| </HTML> |