The RestEndpointInvocationHandler
wraps the endpoint resource method, followed by the CacheResponseFilter
. The RestEndpointInvocationHandler
is the main Nucleus component responsible for invoking matched resource endpoints. This allows you to wrap the endpoint resource method with extra behaviors, and allows the framework to resolve Nucleus request-scoped resource components. If the endpoint is transactional, the RestEndpointInvocationHandler
creates a transaction to wrap the rest of the processing. It also invokes the validation service to validate the input JSON against the schema. If the resource is not a Nucleus component, then it ensures that any fields annotated with NucleusComponent
are resolved. The RestEndpointInvocationHandler
also invokes any preAction
or postAction
annotated methods for the endpoint, as well as invoking the endpoint itself. It then ends the transaction. If the resource is a global Nucleus component, then the RestEndpointInvocationHandler
resolves it and ensures that any Jersey injection needed to populate fields occurs.
For detailed information on wrapping endpoint methods, refer to the Running Methods Before or After Endpoints section.