Rename nettyServerCustomizers to serverCustomizers

Closes gh-11155
pull/11189/merge
Stephane Nicoll 7 years ago
parent 9044b5a215
commit 55f7b3a535

@ -40,7 +40,7 @@ import org.springframework.util.Assert;
*/ */
public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory { public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFactory {
private List<NettyServerCustomizer> nettyServerCustomizers = new ArrayList<>(); private List<NettyServerCustomizer> serverCustomizers = new ArrayList<>();
public NettyReactiveWebServerFactory() { public NettyReactiveWebServerFactory() {
} }
@ -62,29 +62,29 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
* applied to the Netty server builder. * applied to the Netty server builder.
* @return the customizers that will be applied * @return the customizers that will be applied
*/ */
public Collection<NettyServerCustomizer> getNettyServerCustomizers() { public Collection<NettyServerCustomizer> getServerCustomizers() {
return this.nettyServerCustomizers; return this.serverCustomizers;
} }
/** /**
* Set {@link NettyServerCustomizer}s that should be applied to the Netty server * Set {@link NettyServerCustomizer}s that should be applied to the Netty server
* builder. Calling this method will replace any existing customizers. * builder. Calling this method will replace any existing customizers.
* @param nettyServerCustomizers the customizers to set * @param serverCustomizers the customizers to set
*/ */
public void setNettyServerCustomizers( public void setServerCustomizers(
Collection<? extends NettyServerCustomizer> nettyServerCustomizers) { Collection<? extends NettyServerCustomizer> serverCustomizers) {
Assert.notNull(nettyServerCustomizers, "NettyServerCustomizers must not be null"); Assert.notNull(serverCustomizers, "NettyServerCustomizers must not be null");
this.nettyServerCustomizers = new ArrayList<>(nettyServerCustomizers); this.serverCustomizers = new ArrayList<>(serverCustomizers);
} }
/** /**
* Add {@link NettyServerCustomizer}s that should applied while building the server. * Add {@link NettyServerCustomizer}s that should applied while building the server.
* @param nettyServerCustomizer the customizers to add * @param nettyServerCustomizer the customizers to add
*/ */
public void addContextCustomizers(NettyServerCustomizer... nettyServerCustomizer) { public void addServerCustomizers(NettyServerCustomizer... nettyServerCustomizer) {
Assert.notNull(nettyServerCustomizer, Assert.notNull(nettyServerCustomizer,
"NettyWebServerCustomizer must not be null"); "NettyWebServerCustomizer must not be null");
this.nettyServerCustomizers.addAll(Arrays.asList(nettyServerCustomizer)); this.serverCustomizers.addAll(Arrays.asList(nettyServerCustomizer));
} }
private HttpServer createHttpServer() { private HttpServer createHttpServer() {
@ -107,7 +107,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
} }
private void applyCustomizers(Builder options) { private void applyCustomizers(Builder options) {
this.nettyServerCustomizers this.serverCustomizers
.forEach((customizer) -> customizer.customize(options)); .forEach((customizer) -> customizer.customize(options));
} }

@ -64,7 +64,7 @@ public class NettyReactiveWebServerFactoryTests
for (int i = 0; i < customizers.length; i++) { for (int i = 0; i < customizers.length; i++) {
customizers[i] = mock(NettyServerCustomizer.class); customizers[i] = mock(NettyServerCustomizer.class);
} }
factory.setNettyServerCustomizers(Arrays.asList(customizers[0], customizers[1])); factory.setServerCustomizers(Arrays.asList(customizers[0], customizers[1]));
this.webServer = factory.getWebServer(new EchoHandler()); this.webServer = factory.getWebServer(new EchoHandler());
InOrder ordered = inOrder((Object[]) customizers); InOrder ordered = inOrder((Object[]) customizers);
for (NettyServerCustomizer customizer : customizers) { for (NettyServerCustomizer customizer : customizers) {

Loading…
Cancel
Save