@Stateless @Local(BookOrderingService.class) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) @Interceptors(PreconditionInterceptor.class) //optional public class BookOrderingServiceBean implements BookOrderingService { @EJB DeliveryService deliveryService; }
The business interface is just a POJI. It is not dependent on the EJB API at all.
The code above (with several strategies, interceptors and ideas) was checked in (actually pushed :-)) into: http://kenai.com/projects/javaee-patterns