3.5. Anatomy of an EJB

When authoring a session or entity EJB, the developer must provide at least three Java .class files: two interfaces that expose the methods of the EJB that are accessible to clients, and an implementation class (often called the ‘bean class’ or ‘EJB class’). We need two interfaces because one exposes the factory methods of the EJB (create(), find()), while the other exposes the business methods that can be called on the specific EJB. In EJB 1.1, all EJB method calls were RMI calls, and only one pair of interfaces was required, the home interface and the remote interface. Of these, the former exposed the factory methods, and the latter the business methods.

As we have discussed, in EJB 2.0, to support the notion of intra-JVM ...

Get Applied Enterprise JavaBeans™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.