<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- Content Stylesheet for Site --> <!-- start the processing --> <!-- ====================================================================== --> <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! --> <!-- Main Page Section --> <!-- ====================================================================== --> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /> <meta name="author" content="Checkstyle Development Team"> <meta name="email" content="$au.getAttributeValue("email")"> <title>Checkstyle - J2EE Checks</title> <style type="text/css" media="all"> @import url("./css/cs-layout.css"); @import url("./css/cs-style.css"); </style> </head> <body> <div class="csTopBar"> <div class="csTopBarContents"> <div class="csLeft"> <h1>J2EE Checks</h1> </div> <div class="csRight"> <a href="http://checkstyle.sourceforge.net/"> <img src="images/logo.png" alt="Checkstyle Logo" height="70"/> </a> </div> </div> </div> <div class="csMiddleContainer"> <div class="csLeftBar"> <div class="csLeftBarContents"> <!-- ============================================================ --> <!-- start makeNavigationBar --> <ul> <li> <strong>About</strong> </li> <li> <a href="./index.html">Checkstyle</a> </li> <li> <strong>Documentation</strong> </li> <li> <a href="./releasenotes.html">Release Notes</a> </li> <li> <a href="./config.html">Configuration</a> </li> <li> <a href="./property_types.html"> Property Types</a> </li> <li> <a href="./running.html">Running</a> </li> <li> <a href="./anttask.html"> Ant Task</a> </li> <li> <a href="./cmdline.html"> Command Line</a> </li> <li> <a href="./availablechecks.html">Available Checks</a> </li> <li> <a href="./checks.html">Standard Checks</a> </li> <li> <a href="./config_javadoc.html"> Javadoc Comments</a> </li> <li> <a href="./config_naming.html"> Naming Conventions</a> </li> <li> <a href="./config_header.html"> Headers</a> </li> <li> <a href="./config_imports.html"> Imports</a> </li> <li> <a href="./config_sizes.html"> Size Violations</a> </li> <li> <a href="./config_whitespace.html"> Whitespace</a> </li> <li> <a href="./config_modifier.html"> Modifiers</a> </li> <li> <a href="./config_blocks.html"> Block Checks</a> </li> <li> <a href="./config_coding.html"> Coding</a> </li> <li> <a href="./config_design.html"> Class Design</a> </li> <li> <a href="./config_duplicates.html"> Duplicate Code</a> </li> <li> <a href="./config_metrics.html"> Metrics</a> </li> <li> <a href="./config_misc.html"> Miscellaneous</a> </li> <li> <a href="./optional.html">Optional Checks</a> </li> <li><b> <a href="./config_j2ee.html"> J2EE Checks</a> </b></li> <li><a href="#EntityBean"> EntityBean</a></li> <li><a href="#FinalStatic"> FinalStatic</a></li> <li><a href="#LocalHomeInterface"> LocalHomeInterface</a></li> <li><a href="#LocalInterface"> LocalInterface</a></li> <li><a href="#MessageBean"> MessageBean</a></li> <li><a href="#RemoteHomeInterface"> RemoteHomeInterface</a></li> <li><a href="#RemoteInterface"> RemoteInterface</a></li> <li><a href="#SessionBean"> SessionBean</a></li> <li><a href="#ThisParameter"> ThisParameter</a></li> <li><a href="#ThisReturn"> ThisReturn</a></li> <li> <a href="./extending.html">Extending Checkstyle</a> </li> <li> <a href="./writingchecks.html"> Writing checks</a> </li> <li> <a href="./writingfilters.html"> Writing filters</a> </li> <li> <a href="./writinglisteners.html"> Writing listeners</a> </li> <li> <a href="./api/index.html">Javadoc</a> </li> <li> <strong>SourceForge</strong> </li> <li> <a href="http://sourceforge.net/mail/?group_id=29721">Mailing Lists</a> </li> <li> <a href="http://sourceforge.net/tracker/?atid=397078&group_id=29721&func=browse">Bug Database</a> </li> <li> <a href="http://sourceforge.net/tracker/?atid=397081&group_id=29721&func=browse">Feature Requests</a> </li> <li> <strong>Developers</strong> </li> <li> <a href="http://sourceforge.net/projects/checkstyle">Project Page</a> </li> <li> <a href="http://checkstyle.svn.sourceforge.net/viewvc/checkstyle/">SVN Repository</a> </li> <li> <a href="./contributing.html">Contributing</a> </li> </ul> <ul> <li> <strong>Hosted by:</strong> <div align="center"> <p><a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=29721&type=1" width="88" height="31" alt="SourceForge Logo"/></a> </p> </div> </li> </ul> <!-- end makeNavigationBar --> <!-- ============================================================ --> </div> </div> <div class="csMain"> <a id="EntityBean"></a> <h2>EntityBean</h2> <h3>Description</h3> <p> Checks that a direct entity bean, i.e. a class that directly implements <span class="code">javax.ejb.EntityBean</span>, satisfies these class requirements: </p> <ul> <li> The class is defined as <span class="code">public</span>. </li> <li> The class cannot be defined as <span class="code">final</span>. </li> <li> It contains a <span class="code">public</span> constructor with no parameters. </li> <li> It must not define the <span class="code">finalize</span> method. </li> </ul> <p> Checks that methods of a direct entity bean satisfy these requirements: </p> <ul> <li> All <span class="code">ejbCreate<METHOD>(...)</span> methods are <span class="code">public</span>, not <span class="code">final</span>, and not <span class="code">static</span>. </li> <li> The return type of all <span class="code">ejbCreate<METHOD>(...)</span> methods is not <span class="code">void</span>, because the return type must be the entity bean's primary key type. </li> <li> All <span class="code">ejbPostCreate<METHOD>(...)</span> methods are <span class="code">public</span>, not <span class="code">final</span>, and not <span class="code">static</span>. </li> <li> The return type of all <span class="code">ejbPostCreate<METHOD>(...)</span> methods is <span class="code">void</span>. </li> <li> For each <span class="code">ejbCreate<METHOD>(...)</span> method there is a matching <span class="code">ejbPostCreate<METHOD>(...)</span> method. </li> <li> All <span class="code">ejbHome<METHOD>(...)</span> methods are <span class="code">public</span>, and not <span class="code">static</span>. </li> <li> The throws clause of all <span class="code">ejbHome<METHOD>(...)</span> methods does not define the <span class="code">java.rmi.RemoteException</span>. </li> </ul> <p> When the check is configured to check direct entity beans as having bean-managed persistence, checks that methods satisfy these additional requirements: </p> <ul> <li> All <span class="code">ejbFind<METHOD>(...)</span> methods are <span class="code">public</span>, not <span class="code">final</span>, and not <span class="code">static</span>. </li> <li> The return type of all <span class="code">ejbFind<METHOD>(...)</span> methods is not <span class="code">void</span>, because the return type must be the entity bean's primary key type, or a collection of primary keys. </li> <li> There is a <span class="code">ejbFindByPrimaryKey</span> method with one parameter. </li> </ul> <p> When the check is configured to check direct entity beans as having container-managed persistence, checks that methods satisfy these additional requirements: </p> <ul> <li> The throws clause of all <span class="code">ejbCreate<METHOD>(...)</span> methods defines the <span class="code">javax.ejb.CreateException</span>. </li> <li> All <span class="code">ejbSelect<METHOD>(...)</span> methods are <span class="code">public</span> and <span class="code">abstract</span>. </li> <li> The throws clause of all <span class="code">ejbSelect<METHOD>(...)</span> methods defines the <span class="code">javax.ejb.FinderException</span>. </li> </ul> <h3>Properties</h3> <table> <tr class="even"> <th valign="top" align="left" > name </th> <th valign="top" align="left" > description </th> <th valign="top" align="left" > type </th> <th valign="top" align="left" > default value </th> </tr> <tr class="odd"> <td class="odd" > persistence </td> <td class="odd" > type of persistence management </td> <td class="odd" > <a href="property_types.html#persistence">persistence policy</a> </td> <td class="odd" > </td> </tr> </table> <p> Reference: Enterprise JavaBeans? Specification,Version 2.0, sections 10.6 and 12.2. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.EntityBean"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <p> To configure the check to apply the <span class="code">container</span> policy to direct entity beans: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.EntityBean"> <property name="persistence" value="container"/> </module></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="FinalStatic"></a> <h2>FinalStatic</h2> <h3>Description</h3> <p> Checks that all static fields are declared final. </p> <p> Rational: This check ensures consistent runtime semantics so that EJB containers have the flexibility to distribute instances across multiple JVMs. </p> <p> Reference: <a href="http://www.javaworld.com/javaworld/jw-08-2000/jw-0825-ejbrestrict.html">Programming restrictions on EJB</a>. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.FinalStatic"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="LocalHomeInterface"></a> <h2>LocalHomeInterface</h2> <h3>Description</h3> <p> Checks that a direct local home interface, i.e. an interface that directly extends <span class="code">javax.ejb.EJBLocalHome</span>, satisfies these requirements: </p> <ul> <li> The return type of all <span class="code">create<METHOD>(...)</span> methods is not <span class="code">void</span>, because the return type must be the bean's local interface. </li> <li> The throws clause of all <span class="code">create<METHOD>(...)</span> methods defines the <span class="code">javax.ejb.CreateException</span>. </li> <li> The throws clause of all methods does not define the <span class="code">java.rmi.RemoteException</span>. </li> </ul> <p> Reference: Enterprise JavaBeansTM Specification,Version 2.0, sections 6.4 and 9.6. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.LocalHomeInterface"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="LocalInterface"></a> <h2>LocalInterface</h2> <h3>Description</h3> <p> Checks that a direct local interface, i.e. an interface that directly extends <span class="code">javax.ejb.EJBLocalObject</span>, satisfies these requirements: </p> <ul> <li> The throws clause of all methods does not define the <span class="code">java.rmi.RemoteException</span>. </li> </ul> <p> Reference: Enterprise JavaBeansTM Specification,Version 2.0, section 9.10. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.LocalInterface"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="MessageBean"></a> <h2>MessageBean</h2> <h3>Description</h3> <p> Checks that a direct message bean, i.e. a class that directly implements <span class="code">javax.ejb.MessageDrivenBean</span> and <span class="code">javax.jms.MessageListener</span>, satisfies these class requirements: </p> <ul> <li> The class is defined as <span class="code">public</span>. </li> <li> The class cannot be defined as <span class="code">final</span>. </li> <li> The class cannot be defined as <span class="code">abstract</span>. </li> <li> It contains a <span class="code">public</span> constructor with no parameters. </li> <li> It must not define the <span class="code">finalize</span> method. </li> <li> It defines an <span class="code">ejbCreate()</span> method this is <span class="code">public</span>, not <span class="code">final</span>, not <span class="code">static</span>, has no parameters, and has return type <span class="code">void</span>. </li> </ul> <p> Reference: Enterprise JavaBeans? Specification,Version 2.0, section 15.7. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.MessageBean"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="RemoteHomeInterface"></a> <h2>RemoteHomeInterface</h2> <h3>Description</h3> <p> Checks that a direct remote home interface, i.e. an interface that directly extends <span class="code">javax.ejb.EJBHome</span>, satisfies these requirements: </p> <ul> <li> The return type of all <span class="code">create<METHOD>(...)</span> methods is not <span class="code">void</span>, because the return type must be the bean's remote interface. </li> <li> The throws clause of all <span class="code">create<METHOD>(...)</span> methods defines the <span class="code">javax.ejb.CreateException</span>. </li> <li> The throws clause of all methods defines the <span class="code">java.rmi.RemoteException</span>. </li> </ul> <p> Reference: Enterprise JavaBeansTM Specification,Version 2.0, sections 6.3 and 9.5. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.RemoteHomeInterface"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="RemoteInterface"></a> <h2>RemoteInterface</h2> <h3>Description</h3> <p> Checks that a direct remote interface, i.e. an interface that directly extends <span class="code">javax.ejb.EJBObject</span>, satisfies these requirements: </p> <ul> <li> The throws clause of all methods defines the <span class="code">java.rmi.RemoteException</span>. </li> </ul> <p> Reference: Enterprise JavaBeansTM Specification,Version 2.0, section 9.9. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.RemoteInterface"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="SessionBean"></a> <h2>SessionBean</h2> <h3>Description</h3> <p> Checks that a direct session bean, i.e. a class that directly implements <span class="code">javax.ejb.SessionBean</span>, satisfies these class requirements: </p> <ul> <li> The class is defined as <span class="code">public</span>. </li> <li> The class cannot be defined as <span class="code">final</span>. </li> <li> The class cannot be defined as <span class="code">abstract</span>. </li> <li> It contains a <span class="code">public</span> constructor with no parameters. </li> <li> It must not define the <span class="code">finalize</span> method. </li> <li> It defines an <span class="code">ejbCreate<METHOD>()</span> method this is <span class="code">public</span>, not <span class="code">final</span>, not <span class="code">static</span>, and has return type <span class="code">void</span>. </li> </ul> <p> Reference: Enterprise JavaBeans? Specification,Version 2.0, section 7.10. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.SessionBean"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="ThisParameter"></a> <h2>ThisParameter</h2> <h3>Description</h3> <p> Checks that <span class="code">this</span> is not a parameter of any method calls or constructors for a bean. Instead, you must use the result of the <span class="code">getEJBObject()</span> available in <span class="code">SessionContext</span> or <span class="code">EntityContext</span>. </p> <p> Reference: <a href="http://www.javaworld.com/javaworld/jw-08-2000/jw-0825-ejbrestrict.html">Programming restrictions on EJB</a>. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.ThisParameter"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> <a id="ThisReturn"></a> <h2>ThisReturn</h2> <h3>Description</h3> <p> Checks that <span class="code">this</span> is not returned by a bean method. Instead, you must use the result of the <span class="code">getEJBObject()</span> available in <span class="code">SessionContext</span> or <span class="code">EntityContext</span>. </p> <p> Reference: <a href="http://www.javaworld.com/javaworld/jw-08-2000/jw-0825-ejbrestrict.html">Programming restrictions on EJB</a>. </p> <h3>Example</h3> <p> To configure the check: </p> <div align="left"> <table cellspacing="4" cellpadding="0" border="0"> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#ffffff"><pre><module name="j2ee.ThisReturn"/></pre></td> <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> <tr> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td> </tr> </table> </div> <h3>Package</h3> <p> com.puppycrawl.tools.checkstyle.checks.j2ee </p> <h3>Parent Module</h3> <p> <a href="config.html#treewalker">TreeWalker</a> </p> </div> </div> <div class="csBottomBar"> <div class="csBottomBarContents"> Copyright © 2001-2007, Oliver Burn </div> </div> </body> </html> <!-- end the processing -->