Polishing

This commit is contained in:
Juergen Hoeller
2017-05-12 12:50:17 +02:00
parent 650a682659
commit f985f71daf
3 changed files with 21 additions and 28 deletions

View File

@@ -108,11 +108,10 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest {
/**
* Apply {@link #beforeCommit(Supplier) beforeCommit} actions, apply the
* request headers/cookies, and write the request body.
* @param writeAction the action to write the request body or {@code null}
* @param writeAction the action to write the request body (may be {@code null})
* @return a completion publisher
*/
protected Mono<Void> doCommit(Supplier<? extends Mono<Void>> writeAction) {
if (!this.state.compareAndSet(State.NEW, State.COMMITTING)) {
return Mono.empty();
}
@@ -134,15 +133,16 @@ public abstract class AbstractClientHttpRequest implements ClientHttpRequest {
return Flux.concat(actions).next();
}
/**
* Implement this method to apply header changes from {@link #getHeaders()}
* to the underlying response. This method is called once only.
* Apply header changes from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyHeaders();
/**
* Implement this method to add cookies from {@link #getHeaders()} to the
* underlying response. This method is called once only.
* Add cookies from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyCookies();

View File

@@ -183,7 +183,7 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
/**
* Apply {@link #beforeCommit(Supplier) beforeCommit} actions, apply the
* response status and headers/cookies, and write the response body.
* @param writeAction the action to write the response body or {@code null}
* @param writeAction the action to write the response body (may be {@code null})
* @return a completion publisher
*/
protected Mono<Void> doCommit(Supplier<? extends Mono<Void>> writeAction) {
@@ -214,33 +214,32 @@ public abstract class AbstractServerHttpResponse implements ServerHttpResponse {
/**
* Implement this method to write to the underlying the response.
* Write to the underlying the response.
* @param body the publisher to write with
*/
protected abstract Mono<Void> writeWithInternal(Publisher<? extends DataBuffer> body);
/**
* Implement this method to write to the underlying the response, and flush after
* each {@code Publisher<DataBuffer>}.
* Write to the underlying the response, and flush after each {@code Publisher<DataBuffer>}.
* @param body the publisher to write and flush with
*/
protected abstract Mono<Void> writeAndFlushWithInternal(Publisher<? extends Publisher<? extends DataBuffer>> body);
/**
* Implement this method to write the status code to the underlying response.
* Write the status code to the underlying response.
* This method is called once only.
*/
protected abstract void applyStatusCode();
/**
* Implement this method to apply header changes from {@link #getHeaders()}
* to the underlying response. This method is called once only.
* Apply header changes from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyHeaders();
/**
* Implement this method to add cookies from {@link #getHeaders()} to the
* underlying response. This method is called once only.
* Add cookies from {@link #getHeaders()} to the underlying response.
* This method is called once only.
*/
protected abstract void applyCookies();