Explain the life cycle of an interceptor instance.
Explain the life cycle of an interceptor instance.
Rating:
The life cycle of an interceptor instance depends on the bean class with which the instance is associated. An interceptor instance is created when a bean instance is created. Similarly, it is passivated, activated, or destroyed when, respectively, the associated bean instance is passivated, activated, or destroyed. Interceptor methods are defined through annotations as PostConstruct, PreDestroy, PostActivate, and PrePassivate. These methods can also be specified in the deployment descriptor as post-construct, pre-destroy, post-activate, and pre-passivate elements. The lifecycle callback interceptor methods are invoked in an unspecified transaction and security context. These methods can throw system exceptions at runtime. However, they cannot throw any application exception.
Rating:
Other articles
- What is the version attribute in EJB persistence?
- What are the responsibilities of the Bean Deployer in implementing security?
- What are the responsibilities of a system administrator?
- What is Java Persistence Query Language?
- What is the OneToOne relationship?