blob: 03270c24393d3681facef03a57c471bb91a4028c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.filter.chain;
import com.yahoo.jdisc.Response;
import com.yahoo.jdisc.handler.ContentChannel;
import com.yahoo.jdisc.handler.ResponseHandler;
/**
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
final class ResponseHandlerGuard implements ResponseHandler {
private final ResponseHandler responseHandler;
private boolean done = false;
public ResponseHandlerGuard(ResponseHandler handler) {
this.responseHandler = handler;
}
@Override
public ContentChannel handleResponse(Response response) {
done = true;
return responseHandler.handleResponse(response);
}
public boolean isDone() {
return done;
}
}
|