blob: 2ab04be932e3c10116d490be07f4b198c847f134 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<!-- $PAGETITLE -->
<TITLE>OpenEJB - New in OpenEJB 3.0</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">
<SCRIPT language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></SCRIPT>
<SCRIPT language="javascript" src="http://openejb.apache.org/tweet/jquery.tweet.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">
$(document).ready(function(){
$(".tweet").tweet({
avatar_size: 32,
count: 4,
fetch:25,
username: "openejb",
list: "contributors",
template:"{avatar}{text}",
filter: function(t){ return /openejb/i.test(t["tweet_raw_text"]); },
loading_text: "loading list..."
});
});
</SCRIPT>
</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">&nbsp;</TD>
<TD class="Col3" id="breadcrumbs">
<!-- $TOP_NAV_BAR -->
<A href="index.html" title="Index">Home</A> | <A href="news.html" title="News">News</A> | <A href="faq.html" title="FAQ">FAQ</A> | <A href="download.html" title="Download">Download</A> | <A href="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">&nbsp;</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="index.html" title="Index">Home</A></LI>
<LI><A href="news.html" title="News">News</A></LI>
<LI><A href="faq.html" title="FAQ">FAQ</A></LI>
<LI><A href="download.html" title="Download">Download</A></LI>
<LI><A href="../OPENEJBx30/index.html" title="Index">Documentation</A></LI>
<LI><A href="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="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
<LI><A href="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="local-server.html" title="Local Server">Local</A></LI>
<LI><A href="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="../OPENEJBx30/tomcat.html" title="Tomcat">Tomcat</A></LI>
<LI><A href="geronimo.html" title="Geronimo">Geronimo</A></LI>
<LI><A href="webobjects.html" title="WebObjects">WebObjects</A></LI>
</UL>
<H3><A name="Navigation-Community"></A>Community</H3>
<UL class="alternate" type="square">
<LI><A href="team.html" title="Team">Team</A></LI>
<LI><A href="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="space-index.html" title="Space Index">Site Index</A></LI>
<LI><A href="../OPENEJBx30/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">&nbsp;</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 -->
New in OpenEJB 3.0
</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="NewinOpenEJB3.0-EJB3.0"></A>EJB 3.0</H1>
<P>OpenEJB 3.0 supports the EJB 3.0 specification as well as the prior EJB 2.1, EJB 2.0, and EJB 1.1. New features in EJB 3.0 include:</P>
<UL class="alternate" type="square">
<LI>Annotations instead of xml</LI>
<LI>No home interfaces</LI>
<LI>Business Interfaces</LI>
<LI>Dependency Injection</LI>
<LI>Intercpetors</LI>
<LI>Java Persistence API</LI>
<LI>Service Locator (ala SessionContext.lookup)</LI>
<LI>POJO-style beans</LI>
</UL>
<P>EJB 2.x features since OpenEJB 1.0 also include:</P>
<UL class="alternate" type="square">
<LI>MessageDriven Beans</LI>
<LI>Container-Managed Persistence (CMP) 2.0</LI>
<LI>Timers</LI>
</UL>
<P>The two aspects of EJB that OpenEJB does not yet support are:</P>
<UL class="alternate" type="square">
<LI>Web Services (JAX-WS, JAX-RPC)</LI>
<LI>CORBA</LI>
</UL>
<P>JAX-WS and CORBA support will be added in future releases. Support for the JAX-RPC API is not a planned feature.</P>
<H1><A name="NewinOpenEJB3.0-ExtensionstoEJB3.0"></A>Extensions to EJB 3.0</H1>
<H2><A name="NewinOpenEJB3.0-CMPviaJPA"></A>CMP via JPA</H2>
<P>Our CMP implementation is a thin layer over the new Java Persistence API (JPA). This means when you deploy an old style CMP 1.1 or CMP 2.1 bean it is internally converted and ran as a JPA bean. This makes it possible to use both CMP and JPA in the same application without any coherence issues that can come from using two competing persistence technologies against the same data. Everything is ultimately JPA in the end.</P>
<H2><A name="NewinOpenEJB3.0-ExtendedDependencyInjection"></A>Extended Dependency Injection</H2>
<P>Dependency Injection in EJB 3.0 via @Resource is largely limited to objects provided by the container, such as DataSources, JMS Topics and Queues. It is possible for you to supply your own configuration information for injection, but standard rules allow for only data of type String, Character, Boolean, Integer, Short, Long, Double, Float and Byte. If you needed a URL, for example, you'd have to have it injected as a String then convert it yourself to a URL. This is just plain silly as the conversion of Strings to other basic data types has existed in JavaBeans long before Enterprise JavaBeans existed. </P>
<P>OpenEJB 3.0 supports injection of any data type for which you can supply a JavaBeans PropertyEditor. We include several built-in PropertyEditors already such as Date, InetAddress, Class, File, URL, URI, Map, List and more.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>MyBean.java</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
<SPAN class="code-keyword">import</SPAN> java.net.URI;
<SPAN class="code-keyword">import</SPAN> java.io.File;
<SPAN class="code-keyword">import</SPAN> java.util.Date;
@Stateful
<SPAN class="code-keyword">public</SPAN> class MyBean {
@Resource URI blog;
@Resource Date birthday;
@Resource File homeDirectory;
}
</PRE>
</DIV></DIV>
<H2><A name="NewinOpenEJB3.0-TheMETAINF%2Fenventries.properties"></A>The META-INF/env-entries.properties</H2>
<P>Along the lines of injection, one of the last remaining things in EJB 3 that people need an ejb-jar.xml file for is to supply the value of env-entries. Env Entries are the source of data for all user supplied data injected into your bean; the afore mentioned String, Boolean, Integer, etc. This is a very big burden as each env-entry is going to cost you 5 lines of xml and the complication of having to figure out how to add you bean declaration in xml as an override of an existing bean and not accidentally as a new bean. All this can be very painful when all you want is to supply the value of a few @Resource String fields in you bean class. </P>
<P>To fix this, OpenEJB supports the idea of a META-INF/env-entries.properties file where we will look for the value of things that need injection that are not container controlled resources (i.e. datasources and things of that nature). You can configure you ejbs via a properties file and skip the need for an ejb-jar.xml and it's 5 lines per property madness.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>META-INF/env-entries.properties</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java">
blog = http:<SPAN class="code-comment">//acme.org/myblog
</SPAN>birthday = locale=en_US style=MEDIUM Mar 1, 1954
homeDirectory = /home/esmith/
</PRE>
</DIV></DIV>
<H2><A name="NewinOpenEJB3.0-SupportforGlassFishdescriptors"></A>Support for GlassFish descriptors</H2>
<P>Unit testing EJBs with OpenEJB is a major feature and draw for people, even for people who may still use other app servers for final deployment such as Geronimo or GlassFish. The descriptor format for Geronimo is natively understood by OpenEJB as OpenEJB is the EJB Container provider for Geronimo. However, OpenEJB also supports the GlassFish descriptors so people using GlassFish as their final server can still use OpenEJB for testing EJBs via plain JUnit tests in their build and only have one set of vendor descriptors to maintain.</P>
<H2><A name="NewinOpenEJB3.0-JavaEE5EARandApplicationClientsupport"></A>JavaEE 5 EAR and Application Client support</H2>
<P>JavaEE 5 EARs and Application Clients can be deployed in addition to ejb jars. EAR support is limited to ejbs, application clients, and libraries; WAR files and RAR files will be ignored. Per the JavaEE 5 spec, the META-INF/application.xml and META-INF/application-client.xml files are optional.</P>
<H2><A name="NewinOpenEJB3.0-ApplicationValidationforEJB3.0"></A>Application Validation for EJB 3.0</H2>
<P>Incorrect usage of various new aspects of EJB 3.0 are checked for and reported during the deployment process preventing strange errors and failures. </P>
<P>As usual validation failures (non-compliant issues with your application) are printed out in complier-style &quot;all-at-once&quot; output allowing you to see and fix all your issues in one go. For example, if you have 10 @PersistenceContext annotations that reference an invalid persistence unit, you get all 10 errors on the <B>first</B> deploy rather than one failure on the first deploy with 9 more failed deployments to go.</P>
<P>Validation output comes in three levels. The most verbose level will tell you in detail what you did wrong, what the options are, and what to do next... even including valid code and annotation usage tailored to your app that you can copy and paste into your application. Very ideal for beginners and people using OpenEJB in a classroom setting.</P>
<H2><A name="NewinOpenEJB3.0-MostconfigurableJNDInamesever"></A>Most configurable JNDI names ever</H2>
<H1><A name="NewinOpenEJB3.0-GeneralImprovements"></A>General Improvements</H1>
<H2><A name="NewinOpenEJB3.0-OnlineDeployment"></A>Online Deployment</H2>
<H2><A name="NewinOpenEJB3.0-SecurityService"></A>Security Service</H2>
<H2><A name="NewinOpenEJB3.0-ConnectionPooling"></A>Connection Pooling</H2>
<H2><A name="NewinOpenEJB3.0-ConfigurationOverriding"></A>Configuration Overriding</H2>
<H2><A name="NewinOpenEJB3.0-FlexibleJNDINameFormatting"></A>Flexible JNDI Name Formatting</H2>
<H2><A name="NewinOpenEJB3.0-CleanerEmbedding"></A>Cleaner Embedding</H2>
<H2><A name="NewinOpenEJB3.0-Tomcat6Support"></A>Tomcat 6 Support</H2>
<H2><A name="NewinOpenEJB3.0-Businesslocalsremotable"></A>Business locals remotable</H2>
<P>If you want to make business local interfaces remotable, you can set this property:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java">
openejb.remotable.businessLocals=<SPAN class="code-keyword">true</SPAN>
</PRE>
</DIV></DIV>
<P>Then you can lookup your business local interfaces from remote clients.</P>
<P>You'd still have to ensure that the you pass back and forth is serializable.</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">&nbsp;</TD>
<TD class="Col2">&nbsp;</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=OPENEJB&title=New%20in%20OpenEJB%203.0">[ edit ]</A>
</TD>
</TR>
</TABLE>
<BR>
</TD>
<TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">&nbsp;</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>