HandlerResultHandler.java 1.5 KB
Newer Older
1
/*
2
 * Copyright 2002-2016 the original author or authors.
3 4 5 6 7 8 9 10 11 12 13 14 15
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
A
Arjen Poutsma 已提交
16

17
package org.springframework.web.reactive;
18

19
import reactor.core.publisher.Mono;
20

21
import org.springframework.web.server.ServerWebExchange;
R
Rossen Stoyanchev 已提交
22

23
/**
24 25
 * Process the {@link HandlerResult}, usually returned by an {@link HandlerAdapter}.
 *
26
 * @author Rossen Stoyanchev
27
 * @author Sebastien Deleuze
28
 * @since 5.0
29 30 31
 */
public interface HandlerResultHandler {

32
	/**
R
Polish  
Rossen Stoyanchev 已提交
33
	 * Whether this handler supports the given {@link HandlerResult}.
34 35 36
	 * @param result result object to check
	 * @return whether or not this object can use the given result
	 */
37 38
	boolean supports(HandlerResult result);

39
	/**
R
Polish  
Rossen Stoyanchev 已提交
40 41
	 * Process the given result modifying response headers and/or writing data
	 * to the response.
R
Rossen Stoyanchev 已提交
42 43
	 * @param exchange current server exchange
	 * @param result the result from the handling
R
Polish  
Rossen Stoyanchev 已提交
44
	 * @return {@code Mono<Void>} to indicate when request handling is complete.
45
	 */
46
	Mono<Void> handleResult(ServerWebExchange exchange, HandlerResult result);
47

48
}