Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2012-08-03 11:49:53 -0400
committerJoakim Erdfelt2012-08-03 11:49:53 -0400
commit03521a9a9936264fd781204de8c67af311d2cf05 (patch)
treef11571efeca3ac6ce2d14daa303062f97f771215 /jetty-websocket
parent65cb45308044c4ef0684c99767557e839d81999c (diff)
parent2d7b6c9c06f7e7ee73a2cb9ec8ae3b0e94adac2c (diff)
downloadorg.eclipse.jetty.project-03521a9a9936264fd781204de8c67af311d2cf05.tar.gz
org.eclipse.jetty.project-03521a9a9936264fd781204de8c67af311d2cf05.tar.xz
org.eclipse.jetty.project-03521a9a9936264fd781204de8c67af311d2cf05.zip
Merge branch 'jetty-9' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project into jetty-9
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/HandshakeConnection.java14
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java (renamed from jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java)8
-rw-r--r--jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java29
-rw-r--r--jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java2
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/AbstractWebSocketConnection.java (renamed from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java)29
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java2
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java2
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java4
-rw-r--r--jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java (renamed from jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerAsyncConnection.java)8
-rw-r--r--jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java8
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java2
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketLoadRFC6455Test.java15
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java5
-rw-r--r--jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples/echo/ExampleEchoServer.java2
14 files changed, 69 insertions, 61 deletions
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/HandshakeConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/HandshakeConnection.java
index 5ea0b01b85..a96dd5c8ec 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/HandshakeConnection.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/HandshakeConnection.java
@@ -22,9 +22,9 @@ import java.util.Random;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
-import org.eclipse.jetty.io.AbstractAsyncConnection;
-import org.eclipse.jetty.io.AsyncConnection;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.AbstractConnection;
+import org.eclipse.jetty.io.Connection;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.B64Code;
import org.eclipse.jetty.util.FutureCallback;
@@ -32,14 +32,14 @@ import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.eclipse.jetty.websocket.client.WebSocketClient.ConnectFuture;
-import org.eclipse.jetty.websocket.io.WebSocketAsyncConnection;
+import org.eclipse.jetty.websocket.io.AbstractWebSocketConnection;
/**
* Default Handshake Connection.
* <p>
- * Results in a {@link WebSocketAsyncConnection} on successful handshake.
+ * Results in a {@link AbstractWebSocketConnection} on successful handshake.
*/
-public class HandshakeConnection extends AbstractAsyncConnection implements AsyncConnection
+public class HandshakeConnection extends AbstractConnection implements Connection
{
public static final String COOKIE_DELIM = "\"\\\n\r\t\f\b%+ ;=";
private final WebSocketClient.ConnectFuture future;
@@ -47,7 +47,7 @@ public class HandshakeConnection extends AbstractAsyncConnection implements Asyn
private String key;
- public HandshakeConnection(AsyncEndPoint endp, Executor executor, ByteBufferPool bufferPool, WebSocketClient.ConnectFuture future)
+ public HandshakeConnection(EndPoint endp, Executor executor, ByteBufferPool bufferPool, WebSocketClient.ConnectFuture future)
{
super(endp,executor);
this.future = future;
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java
index 58ebadbc4f..effd3f14f6 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientAsyncConnection.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientConnection.java
@@ -3,17 +3,17 @@ package org.eclipse.jetty.websocket.client.io;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
import org.eclipse.jetty.websocket.client.WebSocketClientFactory;
-import org.eclipse.jetty.websocket.io.WebSocketAsyncConnection;
+import org.eclipse.jetty.websocket.io.AbstractWebSocketConnection;
-public class WebSocketClientAsyncConnection extends WebSocketAsyncConnection
+public class WebSocketClientConnection extends AbstractWebSocketConnection
{
private final WebSocketClientFactory factory;
- public WebSocketClientAsyncConnection(AsyncEndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy,
+ public WebSocketClientConnection(EndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy,
ByteBufferPool bufferPool, WebSocketClientFactory factory)
{
super(endp,executor,scheduler,policy,bufferPool);
diff --git a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
index 7907510062..9f29e1dad1 100644
--- a/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
+++ b/jetty-websocket/websocket-client/src/main/java/org/eclipse/jetty/websocket/client/io/WebSocketClientSelectorManager.java
@@ -25,18 +25,19 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLException;
-import org.eclipse.jetty.io.AsyncConnection;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.Connection;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.SelectChannelEndPoint;
import org.eclipse.jetty.io.SelectorManager;
import org.eclipse.jetty.io.ssl.SslConnection;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.websocket.api.WebSocketConnection;
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.eclipse.jetty.websocket.client.WebSocketClientFactory;
import org.eclipse.jetty.websocket.driver.WebSocketEventDriver;
-import org.eclipse.jetty.websocket.io.WebSocketAsyncConnection;
+import org.eclipse.jetty.websocket.io.AbstractWebSocketConnection;
public class WebSocketClientSelectorManager extends SelectorManager
{
@@ -66,7 +67,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
return sslContextFactory;
}
- public AsyncConnection newAsyncConnection(SocketChannel channel, AsyncEndPoint endPoint, Object attachment)
+ public AbstractWebSocketConnection newWebSocketConnection(SocketChannel channel, EndPoint endPoint, Object attachment)
{
WebSocketClient.ConnectFuture confut = (WebSocketClient.ConnectFuture)attachment;
WebSocketClientFactory factory = confut.getFactory();
@@ -77,8 +78,8 @@ public class WebSocketClientSelectorManager extends SelectorManager
ByteBufferPool bufferPool = factory.getBufferPool();
ScheduledExecutorService scheduler = factory.getScheduler();
- WebSocketAsyncConnection connection = new WebSocketClientAsyncConnection(endPoint,executor,scheduler,policy,bufferPool,factory);
- endPoint.setAsyncConnection(connection);
+ AbstractWebSocketConnection connection = new WebSocketClientConnection(endPoint,executor,scheduler,policy,bufferPool,factory);
+ endPoint.setConnection(connection);
connection.getParser().setIncomingFramesHandler(websocket);
// TODO: track open websockets? bind open websocket to connection?
@@ -87,7 +88,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
}
@Override
- public AsyncConnection newConnection(SocketChannel channel, AsyncEndPoint endPoint, Object attachment)
+ public Connection newConnection(SocketChannel channel, EndPoint endPoint, Object attachment)
{
WebSocketClient.ConnectFuture confut = (WebSocketClient.ConnectFuture)attachment;
@@ -97,7 +98,7 @@ public class WebSocketClientSelectorManager extends SelectorManager
if ((sslContextFactory != null) && ("wss".equalsIgnoreCase(scheme)))
{
- final AtomicReference<AsyncEndPoint> sslEndPointRef = new AtomicReference<>();
+ final AtomicReference<EndPoint> sslEndPointRef = new AtomicReference<>();
final AtomicReference<Object> attachmentRef = new AtomicReference<>(attachment);
SSLEngine engine = newSSLEngine(sslContextFactory,channel);
SslConnection sslConnection = new SslConnection(bufferPool,executor,endPoint,engine)
@@ -110,20 +111,20 @@ public class WebSocketClientSelectorManager extends SelectorManager
super.onClose();
}
};
- endPoint.setAsyncConnection(sslConnection);
- AsyncEndPoint sslEndPoint = sslConnection.getSslEndPoint();
+ endPoint.setConnection(sslConnection);
+ EndPoint sslEndPoint = sslConnection.getDecryptedEndPoint();
sslEndPointRef.set(sslEndPoint);
startHandshake(engine);
- AsyncConnection connection = newAsyncConnection(channel,sslEndPoint,attachment);
- endPoint.setAsyncConnection(connection);
+ Connection connection = newWebSocketConnection(channel,sslEndPoint,attachment);
+ endPoint.setConnection(connection);
return connection;
}
else
{
- AsyncConnection connection = newAsyncConnection(channel,endPoint,attachment);
- endPoint.setAsyncConnection(connection);
+ Connection connection = newWebSocketConnection(channel,endPoint,attachment);
+ endPoint.setConnection(connection);
return connection;
}
}
diff --git a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java
index 4e593e1cf6..7fa60a3ab7 100644
--- a/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java
+++ b/jetty-websocket/websocket-client/src/test/java/org/eclipse/jetty/websocket/client/WebSocketClientTest.java
@@ -143,7 +143,7 @@ public class WebSocketClientTest
}
@Test
- public void testAsyncConnectionRefused() throws Exception
+ public void testConnectionRefused() throws Exception
{
WebSocketClientFactory factory = new WebSocketClientFactory();
WebSocketClient client = factory.newWebSocketClient();
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/AbstractWebSocketConnection.java
index ed8ce60876..fde5bcc1d6 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/AbstractWebSocketConnection.java
@@ -25,9 +25,9 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
-import org.eclipse.jetty.io.AbstractAsyncConnection;
-import org.eclipse.jetty.io.AsyncConnection;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.AbstractConnection;
+import org.eclipse.jetty.io.Connection;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.Callback;
@@ -46,11 +46,11 @@ import org.eclipse.jetty.websocket.protocol.Parser;
import org.eclipse.jetty.websocket.protocol.WebSocketFrame;
/**
- * Provides the implementation of {@link WebSocketConnection} within the framework of the new {@link AsyncConnection} framework of jetty-io
+ * Provides the implementation of {@link WebSocketConnection} within the framework of the new {@link Connection} framework of jetty-io
*/
-public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection implements RawConnection, OutgoingFrames
+public abstract class AbstractWebSocketConnection extends AbstractConnection implements RawConnection, OutgoingFrames
{
- private static final Logger LOG = Log.getLogger(WebSocketAsyncConnection.class);
+ private static final Logger LOG = Log.getLogger(AbstractWebSocketConnection.class);
private static final Logger LOG_FRAMES = Log.getLogger("org.eclipse.jetty.websocket.io.Frames");
private final ByteBufferPool bufferPool;
@@ -64,7 +64,7 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
private boolean flushing;
private AtomicLong writes;
- public WebSocketAsyncConnection(AsyncEndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool)
+ public AbstractWebSocketConnection(EndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool)
{
super(endp,executor);
this.policy = policy;
@@ -78,6 +78,13 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
}
@Override
+ public void onOpen()
+ {
+ super.onOpen();
+ fillInterested();
+ }
+
+ @Override
public void close() throws IOException
{
terminateConnection(StatusCode.NORMAL,null);
@@ -104,7 +111,7 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
@Override
public void disconnect(boolean onlyOutput)
{
- AsyncEndPoint endPoint = getEndPoint();
+ EndPoint endPoint = getEndPoint();
// We need to gently close first, to allow
// SSL close alerts to be sent by Jetty
LOG.debug("Shutting down output {}",endPoint);
@@ -268,7 +275,7 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
private int read(ByteBuffer buffer)
{
- AsyncEndPoint endPoint = getEndPoint();
+ EndPoint endPoint = getEndPoint();
try
{
while (true)
@@ -358,9 +365,9 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
return String.format("%s{g=%s,p=%s}",super.toString(),generator,parser);
}
- private <C> void write(ByteBuffer buffer, WebSocketAsyncConnection webSocketAsyncConnection, FrameBytes<C> frameBytes)
+ private <C> void write(ByteBuffer buffer, AbstractWebSocketConnection webSocketConnection, FrameBytes<C> frameBytes)
{
- AsyncEndPoint endpoint = getEndPoint();
+ EndPoint endpoint = getEndPoint();
if (LOG_FRAMES.isDebugEnabled())
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
index f42067df2a..650cd438f8 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
@@ -28,7 +28,7 @@ public class ControlFrameBytes<C> extends FrameBytes<C>
private static final Logger LOG = Log.getLogger(ControlFrameBytes.class);
private ByteBuffer buffer;
- public ControlFrameBytes(WebSocketAsyncConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
+ public ControlFrameBytes(AbstractWebSocketConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
{
super(connection,callback,context,frame);
}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
index 570ab6ea24..cabeb32623 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
@@ -27,7 +27,7 @@ public class DataFrameBytes<C> extends FrameBytes<C>
private static final Logger LOG = Log.getLogger(DataFrameBytes.class);
private ByteBuffer buffer;
- public DataFrameBytes(WebSocketAsyncConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
+ public DataFrameBytes(AbstractWebSocketConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
{
super(connection,callback,context,frame);
}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
index abd0644cf6..58371b04af 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
@@ -29,14 +29,14 @@ import org.eclipse.jetty.websocket.protocol.WebSocketFrame;
public abstract class FrameBytes<C> implements Callback<C>, Runnable
{
private final static Logger LOG = Log.getLogger(FrameBytes.class);
- protected final WebSocketAsyncConnection connection;
+ protected final AbstractWebSocketConnection connection;
protected final Callback<C> callback;
protected final C context;
protected final WebSocketFrame frame;
// Task used to timeout the bytes
protected volatile ScheduledFuture<?> task;
- protected FrameBytes(WebSocketAsyncConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
+ protected FrameBytes(AbstractWebSocketConnection connection, Callback<C> callback, C context, WebSocketFrame frame)
{
this.connection = connection;
this.callback = callback;
diff --git a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerAsyncConnection.java b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java
index b0f82bed8c..3265dabcde 100644
--- a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerAsyncConnection.java
+++ b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerConnection.java
@@ -3,17 +3,17 @@ package org.eclipse.jetty.websocket.server;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.websocket.api.WebSocketPolicy;
-import org.eclipse.jetty.websocket.io.WebSocketAsyncConnection;
+import org.eclipse.jetty.websocket.io.AbstractWebSocketConnection;
-public class WebSocketServerAsyncConnection extends WebSocketAsyncConnection
+public class WebSocketServerConnection extends AbstractWebSocketConnection
{
private final WebSocketServerFactory factory;
private boolean connected;
- public WebSocketServerAsyncConnection(AsyncEndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy,
+ public WebSocketServerConnection(EndPoint endp, Executor executor, ScheduledExecutorService scheduler, WebSocketPolicy policy,
ByteBufferPool bufferPool, WebSocketServerFactory factory)
{
super(endp,executor,scheduler,policy,bufferPool);
diff --git a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
index ab14da7428..05dea9e0bf 100644
--- a/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
+++ b/jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
@@ -33,7 +33,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpStatus;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.StandardByteBufferPool;
import org.eclipse.jetty.server.HttpConnection;
@@ -353,10 +353,10 @@ public class WebSocketServerFactory extends AbstractLifeCycle implements WebSock
// Create connection
HttpConnection http = HttpConnection.getCurrentConnection();
- AsyncEndPoint endp = http.getEndPoint();
- Executor executor = http.getConnector().findExecutor();
+ EndPoint endp = http.getEndPoint();
+ Executor executor = http.getConnector().getExecutor();
ByteBufferPool bufferPool = http.getConnector().getByteBufferPool();
- WebSocketServerAsyncConnection connection = new WebSocketServerAsyncConnection(endp,executor,scheduler,websocket.getPolicy(),bufferPool,this);
+ WebSocketServerConnection connection = new WebSocketServerConnection(endp,executor,scheduler,websocket.getPolicy(),bufferPool,this);
// Tell jetty about the new connection
request.setAttribute(HttpConnection.UPGRADE_CONNECTION_ATTR,connection);
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java
index 6ab88b8b26..b7abe00029 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/SimpleServletServer.java
@@ -45,7 +45,7 @@ public class SimpleServletServer
{
// Configure Server
server = new Server();
- connector = new SelectChannelConnector();
+ connector = new SelectChannelConnector(server);
server.addConnector(connector);
ServletContextHandler context = new ServletContextHandler();
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketLoadRFC6455Test.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketLoadRFC6455Test.java
index 789ab727c2..c769ffeeab 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketLoadRFC6455Test.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketLoadRFC6455Test.java
@@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit;
import junit.framework.Assert;
-import org.eclipse.jetty.io.AsyncEndPoint;
+import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.SelectChannelConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.DefaultHandler;
@@ -59,7 +59,7 @@ public class WebSocketLoadRFC6455Test
private final BufferedReader input;
private final int iterations;
private final CountDownLatch latch;
- private/* final */AsyncEndPoint _endp;
+ private/* final */EndPoint _endp;
private final Generator _generator;
private final Parser _parser;
private final IncomingFrames _handler = new IncomingFrames()
@@ -158,14 +158,13 @@ public class WebSocketLoadRFC6455Test
@BeforeClass
public static void startServer() throws Exception
{
- _server = new Server();
-
- _connector = new SelectChannelConnector();
- _server.addConnector(_connector);
-
QueuedThreadPool threadPool = new QueuedThreadPool(200);
threadPool.setMaxStopTimeMs(1000);
- _server.setThreadPool(threadPool);
+ _server = new Server(threadPool);
+ _server.manage(threadPool);
+
+ _connector = new SelectChannelConnector(_server);
+ _server.addConnector(_connector);
WebSocketHandler wsHandler = new WebSocketHandler.Simple(MyEchoSocket.class);
wsHandler.setHandler(new DefaultHandler());
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
index 25c54d2090..971ff14b7b 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketOverSSLTest.java
@@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
+import org.eclipse.jetty.server.SelectChannelConnector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
@@ -95,9 +96,9 @@ public class WebSocketOverSSLTest
private void startServer(final Object websocket) throws Exception
{
_server = new Server();
- SslSelectChannelConnector connector = new SslSelectChannelConnector();
+ SelectChannelConnector connector = new SelectChannelConnector(_server,true);
_server.addConnector(connector);
- SslContextFactory cf = connector.getSslContextFactory();
+ SslContextFactory cf = connector.getConnectionFactory().getSslContextFactory();
cf.setKeyStorePath(MavenTestingUtils.getTestResourceFile("keystore").getAbsolutePath());
cf.setKeyStorePassword("storepwd");
cf.setKeyManagerPassword("keypwd");
diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples/echo/ExampleEchoServer.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples/echo/ExampleEchoServer.java
index f9ee1c5746..e6d3857f52 100644
--- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples/echo/ExampleEchoServer.java
+++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/examples/echo/ExampleEchoServer.java
@@ -89,7 +89,7 @@ public class ExampleEchoServer
public ExampleEchoServer(int port)
{
server = new Server();
- connector = new SelectChannelConnector();
+ connector = new SelectChannelConnector(server);
connector.setPort(port);
server.addConnector(connector);

Back to the top