juzu.request

## Interface RequestLifeCycle

-     public interface RequestLifeCycle

  This interface can be implemented by a controller to be aware of the dispatch of a request on the controller.
  Author:
    Julien Viet

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beginRequest(RequestContext context)` Signals to the controller that a request begins.
    `void` | `endRequest(RequestContext context)` Signals to the controller that a request ends.

- - ### Method Detail

    - #### beginRequest

          void beginRequest(RequestContext context)

      Signals to the controller that a request begins. During the invocation of this method, if a `Response` is set on the request context, the request will be considered as terminated.

      When this method throws a runtime exception, a `Response.Error` response will be set on the request context, thus terminating the request.

      Parameters:
        `context` - the request context

    - #### endRequest

          void endRequest(RequestContext context)

      Signals to the controller that a request ends. During the invocation of this method, the response set during the dispatch of the request is available via the `RequestContext.getResponse()` method, this method is free to override it and provide a new response instead.

      When this method throws a runtime exception, a `Response.Error` response will be set on the request context, thus terminating the request.

      Parameters:
        `context` - the request context

Copyright © 2014 eXo Platform SAS. All rights reserved.