Java 类org.glassfish.jersey.server.monitoring.RequestEvent.Type 实例源码

项目:micrometer    文件:DefaultJerseyTagsProviderTest.java   
private static RequestEvent event(String method, Integer status, Exception exception,
        String baseUri, String... uriTemplateStrings) {
    Builder builder = new RequestEventImpl.Builder();

    ContainerRequest containerRequest = mock(ContainerRequest.class);
    when(containerRequest.getMethod()).thenReturn(method);
    builder.setContainerRequest(containerRequest);

    ContainerResponse containerResponse = mock(ContainerResponse.class);
    when(containerResponse.getStatus()).thenReturn(status);
    builder.setContainerResponse(containerResponse);

    builder.setException(exception, null);

    ExtendedUriInfo extendedUriInfo = mock(ExtendedUriInfo.class);
    when(extendedUriInfo.getBaseUri()).thenReturn(
            URI.create("http://localhost:8080" + (baseUri == null ? "/" : baseUri)));
    List<UriTemplate> uriTemplates = uriTemplateStrings == null ? Collections.emptyList()
            : Arrays.stream(uriTemplateStrings).map(uri -> new UriTemplate(uri))
                    .collect(Collectors.toList());
    // UriTemplate are returned in reverse order
    Collections.reverse(uriTemplates);
    when(extendedUriInfo.getMatchedTemplates()).thenReturn(uriTemplates);
    builder.setExtendedUriInfo(extendedUriInfo);

    return builder.build(Type.FINISHED);
}
项目:jqm    文件:ExceptionLogger.java   
@Override
public void onEvent(RequestEvent paramRequestEvent)
{
    if (paramRequestEvent.getType() == Type.ON_EXCEPTION)
    {
        log.info("a REST call failed with an exception", paramRequestEvent.getException());
    }
}
项目:ameba    文件:RequestEvent.java   
/**
 * <p>getType.</p>
 *
 * @return a {@link org.glassfish.jersey.server.monitoring.RequestEvent.Type} object.
 */
public Type getType() {
    return event.getType();
}