IntelliJ Community . EjbHighlightingFeatures

 
EjbHighlightingFeatures 

HOME INDEX SEARCH CHANGES GO  
These requirements are supported, as stated in EJB 2.0 spec ( http://java.sun.com/products/ejb/docs.html ). Where possible, 'quick fix' intentions are provided (e.g. 'add CreateException? to create() method throws list')

EJB Java code Errors (EB=Entity Bean, SB=Session Bean, MB=Message Driven Bean)

  • for EJB Interface (including EJB Remote, Local, Remote Home, Local Home)
    • should be not final interface extending corresponding javax.ejb.XXX interface (note: this can be indirect...these interfaces just need to be eventually derived from the correct one. -- WalterMundt)
    • all methods should be implemented in EJB Class (except finders for EB CMP)
  • for EJB Remote-involved class (including EJB Remote Interface, Remote Home interface)
    • all methods should throw java.rmi.RemoteException
    • all methods arguments and return types should be RMI/IIOP compatible
  • for EJB Local-involved class (including EJB Local Interface, Local Home interface)
    • all methods should not throw java.rmi.RemoteException
  • for EJB Home (including Remote Home, Local Home)
    • SB, MB should define create method
    • EB should define findByPrimaryKey method which returns component interface
    • create method should throw CreateException? and return component interface
    • Stateless SB should define the only create()
    • finder method should throw FinderException? and return component interface or Collection
  • for EJB Local interface
    • CMR field accessor signature should be consistent with ejb-jar.xml
  • for EJB Class
    • should extend corresponding javax.ejb.*Bean class
    • should be public, not final
    • EB CMP 2.0 should be abstract, all other should not
    • should define public no-args constructor
    • MB should implement javax.jms.MessageListener
    • should define at least one create method (except EB)
    • EB should define post create method as well
    • for each post create method should be corresponding create method
    • create method should be public,not final,not abstract, defined in Home, should throw CreateException?, return PK (for EB) or void
    • business method should have declaration in component interface
    • should not define finalize()
    • CMP EB should define all CMP/CMR field accessors which should (not for CMP 1.x) be abstract
    • CMP/CMR field getters/setters should be consistent (getter return type and setter argument type should be the same)
    • CMR field accessor signature should be consistent with ejb-jar.xml
    • ejbSelect should be not abstract, should throw FinderException?
    • Business,create,finder methods and method implementations from SessionBean?/EntityBean/MessageDrivenBean interfaces should not throw RemoteException? (warning for EJB 1.x )

EJB Deployment descriptor errors

  • For each Component interface there should be Home interface and vice versa
  • There should be Bean class
  • DD should specify ejb-name
  • for EB following tags should be present: <persistent-type>, <prim-key-class>(RMI/IIOP compatible), <reentrant>
  • CMP/CMR fields should be valid Java identifiers beginning with lower case letter

Java code warnings

  • --- Checks below are performed inside EJB class only (e.g. write to EJB static field from other class is not detected) ---
    • There should not be writes to the EJB static fields
    • EJB should not use java.awt.*, java.io.File*, java.lang.reflect.*, java.security.*, java.net.ServerSocket, java.lang.ClassLoader, java.lang.SecurityManager, java.lang.Thread*
    • EJB should not pass 'this' as method result or argument

-- AlexeyKudravtsev - 28 Jun 2002

e d i t a t t a c h r e f - b y d i f f s m o r e
Have ideas, requests, problems regarding this site? Send feedback.
Copyright © 2000-2003 by the contributing authors. All materials at intellij.org are the property of the contributing authors.