As we have learned in the "Service Objects Management" hike, an EJB 3.0 client uses downloaded stub objects to make method calls against the service objects. The stub delegates the request to the EJB 3.0 server / container, which in turn invokes the managed service object and returns the result. In the process, the EJB 3.0 container can inspect and intercept any method calls that go through it. The container can then apply runtime services before and after the target service method invocation. For instance, the container can check whether the client has the permission to call the method, profile and trace the method invocation stack, and tie multiple calls into a transaction. At the end of a transaction, the container can also perform extra work to commit the transaction or roll it back.
In this hike, we will first explore how to configure transaction and security properties for service objects and methods. In the last trail, we will also discuss how to develop your own interceptors and expand the container services.