Using session beans with more than one business interface

A session bean can use more than one business interface. In this recipe we will use multiple interfaces to illustrate how a subset of methods can be exposed to a client while providing a larger set of methods to the beans of the application. An account EJB is used exposing the discount rates based on the type of client.

Getting ready

The process of adding more than one business interface involves two steps:

  1. Defining the interfaces
  2. Implementing the interfaces in the EJB.

    Each of these steps is not difficult. However, the implementation of the business methods can be a different matter.

How to do it...

Start by creating a Java EE application called MultipleInterfacesExample. In the EJB module add ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.