Skip to content

Commit dfef4e0

Browse files
committed
Added HttpHandler contructor argument
1 parent 7af97c3 commit dfef4e0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/ServletHttpHandlerAdapter.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,19 @@ public class ServletHttpHandlerAdapter extends HttpServlet {
4949

5050
private static Log logger = LogFactory.getLog(ServletHttpHandlerAdapter.class);
5151

52-
private HttpHandler handler;
52+
private final HttpHandler handler;
5353

5454
// Servlet is based on blocking I/O, hence the usage of non-direct, heap-based buffers
5555
// (i.e. 'false' as constructor argument)
5656
private DataBufferFactory dataBufferFactory = new DefaultDataBufferFactory(false);
5757

5858
private int bufferSize = DEFAULT_BUFFER_SIZE;
5959

60-
61-
public void setHandler(HttpHandler handler) {
60+
/**
61+
* Create a new {@code ServletHttpHandlerAdapter} with the given HTTP handler.
62+
* @param handler the handler
63+
*/
64+
public ServletHttpHandlerAdapter(HttpHandler handler) {
6265
Assert.notNull(handler, "'handler' must not be null");
6366
this.handler = handler;
6467
}

0 commit comments

Comments
 (0)