Using deployment descriptors for callback interceptors
Lifecycle callback methods are used to perform special processing during the creation, destruction and other events of an EJB. The callback events available are EJB-specific. In this recipe we will examine the use of deployment descriptors to specify a callback event.
The process for creating a deployment descriptor for interceptors includes:
- Creating an
ejb-jar.xmlfile for the EJB module
- Using the
<interceptors>element to define interceptors
- Adding a lifecycle element to bind the interceptor to an EJB
- Deploying the application
To illustrate the use of a deployment descriptor for a lifecycle method, we will modify the
RegistrationApplication along with the
SimpleInterceptor class ...