Example usage for org.springframework.boot.actuate.endpoint.web WebEndpointResponse STATUS_TOO_MANY_REQUESTS

List of usage examples for org.springframework.boot.actuate.endpoint.web WebEndpointResponse STATUS_TOO_MANY_REQUESTS

Introduction

In this page you can find the example usage for org.springframework.boot.actuate.endpoint.web WebEndpointResponse STATUS_TOO_MANY_REQUESTS.

Prototype

int STATUS_TOO_MANY_REQUESTS

To view the source code for org.springframework.boot.actuate.endpoint.web WebEndpointResponse STATUS_TOO_MANY_REQUESTS.

Click Source Link

Document

429 Too Many Requests .

Usage

From source file:org.springframework.boot.actuate.management.HeapDumpWebEndpoint.java

@ReadOperation
public WebEndpointResponse<Resource> heapDump(@Nullable Boolean live) {
    try {//  w w w. j  a  v a2 s . com
        if (this.lock.tryLock(this.timeout, TimeUnit.MILLISECONDS)) {
            try {
                return new WebEndpointResponse<>(dumpHeap((live != null) ? live : true));
            } finally {
                this.lock.unlock();
            }
        }
    } catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
    } catch (IOException ex) {
        return new WebEndpointResponse<>(WebEndpointResponse.STATUS_INTERNAL_SERVER_ERROR);
    } catch (HeapDumperUnavailableException ex) {
        return new WebEndpointResponse<>(WebEndpointResponse.STATUS_SERVICE_UNAVAILABLE);
    }
    return new WebEndpointResponse<>(WebEndpointResponse.STATUS_TOO_MANY_REQUESTS);
}