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();
}
}
Aggregations