J2EE Checks

EntityBean

Description

Checks that a direct entity bean, i.e. a class that directly implements javax.ejb.EntityBean, satisfies these class requirements:

Checks that methods of a direct entity bean satisfy these requirements:

When the check is configured to check direct entity beans as having bean-managed persistence, checks that methods satisfy these additional requirements:

When the check is configured to check direct entity beans as having container-managed persistence, checks that methods satisfy these additional requirements:

Properties

name description type default value
persistence type of persistence management persistence policy mixed

Reference: Enterprise JavaBeans? Specification,Version 2.0, sections 10.6 and 12.2.

Example

To configure the check:

<module name="j2ee.EntityBean"/>

To configure the check to apply the container policy to direct entity beans:

<module name="j2ee.EntityBean">
    <property name="persistence" value="container"/>
</module>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

FinalStatic

Description

Checks that all static fields are declared final.

Rational: This check ensures consistent runtime semantics so that EJB containers have the flexibility to distribute instances across multiple JVMs.

Reference: Programming restrictions on EJB.

Example

To configure the check:

<module name="j2ee.FinalStatic"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

LocalHomeInterface

Description

Checks that a direct local home interface, i.e. an interface that directly extends javax.ejb.EJBLocalHome, satisfies these requirements:

Reference: Enterprise JavaBeansTM Specification,Version 2.0, sections 6.4 and 9.6.

Example

To configure the check:

<module name="j2ee.LocalHomeInterface"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

LocalInterface

Description

Checks that a direct local interface, i.e. an interface that directly extends javax.ejb.EJBLocalObject, satisfies these requirements:

Reference: Enterprise JavaBeansTM Specification,Version 2.0, section 9.10.

Example

To configure the check:

<module name="j2ee.LocalInterface"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

MessageBean

Description

Checks that a direct message bean, i.e. a class that directly implements javax.ejb.MessageDrivenBean and javax.jms.MessageListener, satisfies these class requirements:

Reference: Enterprise JavaBeans? Specification,Version 2.0, section 15.7.

Example

To configure the check:

<module name="j2ee.MessageBean"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

RemoteHomeInterface

Description

Checks that a direct remote home interface, i.e. an interface that directly extends javax.ejb.EJBHome, satisfies these requirements:

Reference: Enterprise JavaBeansTM Specification,Version 2.0, sections 6.3 and 9.5.

Example

To configure the check:

<module name="j2ee.RemoteHomeInterface"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

RemoteInterface

Description

Checks that a direct remote interface, i.e. an interface that directly extends javax.ejb.EJBObject, satisfies these requirements:

Reference: Enterprise JavaBeansTM Specification,Version 2.0, section 9.9.

Example

To configure the check:

<module name="j2ee.RemoteInterface"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

SessionBean

Description

Checks that a direct session bean, i.e. a class that directly implements javax.ejb.SessionBean, satisfies these class requirements:

Reference: Enterprise JavaBeans? Specification,Version 2.0, section 7.10.

Example

To configure the check:

<module name="j2ee.SessionBean"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

ThisParameter

Description

Checks that this is not a parameter of any method calls or constructors for a bean. Instead, you must use the result of the getEJBObject() available in SessionContext or EntityContext.

Reference: Programming restrictions on EJB.

Example

To configure the check:

<module name="j2ee.ThisParameter"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

ThisReturn

Description

Checks that this is not returned by a bean method. Instead, you must use the result of the getEJBObject() available in SessionContext or EntityContext.

Reference: Programming restrictions on EJB.

Example

To configure the check:

<module name="j2ee.ThisReturn"/>

Package

com.puppycrawl.tools.checkstyle.checks.j2ee

Parent Module

TreeWalker

Copyright © 2001-2007, Oliver Burn