Prepare Undertow 1.3.0 compatibility

Xnio 3.4.0 will introduce a new source of ByteBuffers: ByteBufferPool.
Previously this feature was offered by Pooled/Pool/ByteBufferSlicePool;
those classes are now marked as deprecated.

As of 1.3.0.Beta9, Undertow still implements the following method in its
ClientConnection interface, using those deprecated types:

    Pool<ByteBuffer> getBufferPool();

This commit prepares compatibility by suppressing warnings in order to
avoid build failures in our build. Once appropriate changes are made in
Undertow, a specific implementation with new types could be introduced.

Issue: SPR-13366
This commit is contained in:
Brian Clozel
2015-08-26 14:33:25 +02:00
parent e05fb494f5
commit 42588cb03e
2 changed files with 9 additions and 8 deletions

View File

@@ -38,7 +38,6 @@ import org.springframework.util.SocketUtils;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import org.xnio.ByteBufferSlicePool;
import org.xnio.OptionMap;
import org.xnio.Xnio;
@@ -70,6 +69,7 @@ public class UndertowTestServer implements WebSocketTestServer {
}
@Override
@SuppressWarnings("deprecation")
public void deployConfig(WebApplicationContext wac, Filter... filters) {
Assert.state(this.port != -1, "setup() was never called");
DispatcherServletInstanceFactory servletFactory = new DispatcherServletInstanceFactory(wac);
@@ -78,7 +78,7 @@ public class UndertowTestServer implements WebSocketTestServer {
WebSocketDeploymentInfo info = new WebSocketDeploymentInfo();
try {
info.setWorker(Xnio.getInstance().createWorker(OptionMap.EMPTY));
info.setBuffers(new ByteBufferSlicePool(1024,1024));
info.setBuffers(new org.xnio.ByteBufferSlicePool(1024,1024));
}
catch (IOException ex) {
throw new IllegalStateException(ex);