org.glassfish.jersey.server.monitoring

## Enum RequestEvent.Type

- java.lang.Object
- - java.lang.Enum<RequestEvent.Type>
  - - org.glassfish.jersey.server.monitoring.RequestEvent.Type

All Implemented Interfaces:
  Serializable, Comparable<RequestEvent.Type>

Enclosing interface:
  RequestEvent

    public static enum RequestEvent.Type
    extends Enum<RequestEvent.Type>

The type of the event which describes in which request processing phase the event is triggered.

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`EXCEPTION_MAPPER_FOUND` An `ExceptionMapper` is successfully found and it is going to be executed.
`EXCEPTION_MAPPING_FINISHED` Exception mapping is finished.
`FINISHED` The request and response processing has finished.
`LOCATOR_MATCHED` The sub resource locator method is found and it will be called.
`MATCHING_START` The matching of the resource and resource method has started.
`ON_EXCEPTION` Exception has been thrown during the request/response processing.
`REQUEST_FILTERED` Execution of `container request filters` has been finished.
`REQUEST_MATCHED` The matching has been finished and `container request filters` are going to be executed.
`RESOURCE_METHOD_FINISHED` Resource method execution has finished.
`RESOURCE_METHOD_START` Resource method is going to be executed.
`RESP_FILTERS_FINISHED` Execution of `Container response filters` has finished.
`RESP_FILTERS_START` `Container response filters` are going to be executed.
`START` The request processing has started.
`SUBRESOURCE_LOCATED` The sub resource has been returned from sub resource locator, model was constructed, enhanced by `model processor`, validated and the matching is going to be performed on the sub `resource`.

### Method Summary

All Methods Static Methods Concrete Methods
`static RequestEvent.Type` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static RequestEvent.Type[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### START

    public static final RequestEvent.Type START

The request processing has started. This event type is handled only by `ApplicationEventListener.onRequest(RequestEvent)` and will never be called for `RequestEventListener.onEvent(RequestEvent)`.

#### MATCHING_START

    public static final RequestEvent.Type MATCHING_START

The matching of the resource and resource method has started.

#### LOCATOR_MATCHED

    public static final RequestEvent.Type LOCATOR_MATCHED

The sub resource locator method is found and it will be called. The locator method can be retrieved from `RequestEvent.getUriInfo()` by method `ExtendedUriInfo.getMatchedResourceLocators()`.

#### SUBRESOURCE_LOCATED

    public static final RequestEvent.Type SUBRESOURCE_LOCATED

The sub resource has been returned from sub resource locator, model was constructed, enhanced by `model processor`, validated and the matching is going to be performed on the sub `resource`. The sub resource can be retrieved from `RequestEvent.getUriInfo()` by method `ExtendedUriInfo.getLocatorSubResources()`.

#### REQUEST_MATCHED

    public static final RequestEvent.Type REQUEST_MATCHED

The matching has been finished and `container request filters` are going to be executed. The request filters can be retrieved from event by `RequestEvent.getContainerRequestFilters()` method. This method also determines end of the matching process and therefore the matching results can be retrieved using `RequestEvent.getUriInfo()`.

#### REQUEST_FILTERED

    public static final RequestEvent.Type REQUEST_FILTERED

Execution of `container request filters` has been finished.

#### RESOURCE_METHOD_START

    public static final RequestEvent.Type RESOURCE_METHOD_START

Resource method is going to be executed. The resource method can be extracted from `ExtendedUriInfo` returned by `RequestEvent.getUriInfo()`.

#### RESOURCE_METHOD_FINISHED

    public static final RequestEvent.Type RESOURCE_METHOD_FINISHED

Resource method execution has finished. In the case of synchronous processing the response is not available yet. In the case of asynchronous processing the situation depends on the method design and it in some cases on race conditions. In asynchronous cases this event can be triggered even after the response is completely processed. Exactly defined, this event is triggered when the thread executing the resource method returns from the resource method.

#### RESP_FILTERS_START

    public static final RequestEvent.Type RESP_FILTERS_START

`Container response filters` are going to be executed. In this point the response is already available and can be retrieved by `RequestEvent.getContainerResponse()`. The response filters can be retrieved by `RequestEvent.getContainerResponseFilters()`.

This phase is executed in the regular response processing but might also been executed for processing on response mapped from exceptions by `exception mappers`. In this case the `ON_EXCEPTION` event type precedes this event.

#### RESP_FILTERS_FINISHED

    public static final RequestEvent.Type RESP_FILTERS_FINISHED

Execution of `Container response filters` has finished.

This phase is executed in the regular response processing but might also been executed for processing on response mapped from exceptions by `exception mappers`. In this case the `ON_EXCEPTION` event type precedes this event.

#### ON_EXCEPTION

    public static final RequestEvent.Type ON_EXCEPTION

Exception has been thrown during the request/response processing. This situation can occur in almost all phases of request processing and therefore there is no fixed order of events in which this event type can be triggered.

The origin of exception can be retrieved by `RequestEvent.getExceptionCause()`. This event type can be received even two types in the case when first exception is thrown during the standard request processing and the second one is thrown during the processing of the response mapped from the exception.

The exception thrown can be retrieved by `RequestEvent.getException()`.

#### EXCEPTION_MAPPER_FOUND

    public static final RequestEvent.Type EXCEPTION_MAPPER_FOUND

An `ExceptionMapper` is successfully found and it is going to be executed. The `ExceptionMapper` can be retrieved by `RequestEvent.getExceptionMapper()`.

#### EXCEPTION_MAPPING_FINISHED

    public static final RequestEvent.Type EXCEPTION_MAPPING_FINISHED

Exception mapping is finished. The result of exception mapping can be checked by `RequestEvent.isResponseSuccessfullyMapped()` which returns true when the exception mapping was successful. In this case the new response is available in the `RequestEvent.getContainerResponse()`.

#### FINISHED

    public static final RequestEvent.Type FINISHED

The request and response processing has finished. The result of request processing can be checked by `RequestEvent.isSuccess()` method. This method is called even when request processing fails and ends up with not handled exceptions.

### Method Detail

#### values

    public static RequestEvent.Type[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (RequestEvent.Type c : RequestEvent.Type.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static RequestEvent.Type valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null