Annotation Type RestPostCall


Identifies a method that gets called immediately after the @RestOp annotated method gets called.

At this point, the output object returned by the method call has been set on the response, but RestConverters have not yet been executed and the response has not yet been written.

The list of valid parameter types are as follows:

Example:

@Rest(...) public class MyResource extends BasicRestServlet { // Log the result of the request. @RestPostCall public void onPostCall(RestResponse res, Logger logger) { logger.fine(Output {0} was set on the response.", res.getOutput()); } }

Notes:
  • The method should return void although if it does return any value, the value will be ignored.
  • The method should be public although other visibilities are valid if the security manager allows it.
  • Static methods can be used.
  • Multiple post-call methods can be defined on a class.
    Post-call methods on parent classes are invoked before post-call methods on child classes.
    The order of post-call method invocations within a class is alphabetical, then by parameter count, then by parameter types.
  • The method can throw any exception, although at this point it is too late to set an HTTP error status code.
  • Note that if you override a parent method, you probably need to call super.parentMethod(...).
    The method is still considered part of the parent class for ordering purposes even though it's overridden by the child class.
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Dynamically apply this annotation to the specified methods.