Refer to "3.1.1 What is an EJB?" for an outline of EJB.
The EJB specification in Java EE 6 is EJB 3.1. The following EJB 3.1 specifications have been improved to achieve even greater simplification of development:
There is no need to create EJB-JAR files
Up until now it was necessary to create EJB-JAR files to use EJB, but this is no longer necessary in EJB 3.1.
Classes defined as components with annotations are turned into EJB components by packaging them as jar files in the WEB-INF/classes directory or in the WEB-INF/lib directory.
The local business interface has been omitted
Up until now it was necessary to define the local business interface to use Enterprise Beans locally. With EJB 3.1, however, it is possible to omit the local business interface definition.
Example (existing definition)
Local business interface definition: public interface Calc { public int add(int param1, int param2); } EJB class definition: @Stateless public class CalcBean implements Calc { public int add(int param1, int param2) { return param1 + param2; } } Used from the client: @EJB Calc a; a.add(1,1); |
Example (definition in EJB 3.1)
EJB class definition: @Stateless public class CalcBean { public int add(int param1, int param2) { return param1 + param2; } } Used from the client: @EJB CalcBean a; a.add(1,1); |
Point
Refer to the following specifications for details on EJB 3.1:
JSR 318: Enterprise JavaBeans(TM) 3.1
Refer to "3.2.2 Development Flow" and "3.2.3 Development Procedures" for information on the flow and procedures for developing EJB. Refer to "9.6.1 Preparing to Create Applications" for information on preparations for creating annotations.
Note
The wizard names in the standard workbench and the Java EE 6 workbench may be different.
For example: The [Session Bean] wizard becomes the [Session Bean (EJB 3.x)] wizard.