Search in sources :

Example 1 with CorrelationService

use of org.apache.knox.gateway.audit.api.CorrelationService in project knox by apache.

the class CorrelationHandler method handle.

@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
    CorrelationService correlationService = CorrelationServiceFactory.getCorrelationService();
    CorrelationContext correlationContext = correlationService.createContext();
    correlationContext.setRequestId(UUID.randomUUID().toString());
    try {
        super.handle(target, baseRequest, request, response);
    } finally {
        // Ensure that the correlationContext is destroyed between requests
        correlationContext.destroy();
        correlationService.detachContext();
    }
}
Also used : CorrelationService(org.apache.knox.gateway.audit.api.CorrelationService) CorrelationContext(org.apache.knox.gateway.audit.api.CorrelationContext)

Aggregations

CorrelationContext (org.apache.knox.gateway.audit.api.CorrelationContext)1 CorrelationService (org.apache.knox.gateway.audit.api.CorrelationService)1