diff --git a/VERSION.txt b/VERSION.txt index 42749263e05..5a588980a83 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,4 +1,6 @@ jetty-7.5.0-SNAPSHOT + + 353623 Added new methods to HttpExchange + + 353624 HttpURI accepts java.net.URI object in constructor + 354080 ServletContextHandler allows to replace any subordinate handler when restarted jetty-7.5.0.RC1 - 19 August 2011 diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java index 986da9773e1..6d243383db4 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpDestination.java @@ -678,7 +678,7 @@ public class HttpDestination implements Dumpable setMethod(HttpMethods.CONNECT); setVersion(exchange.getVersion()); String serverHostAndPort = serverAddress.toString(); - setURI(serverHostAndPort); + setRequestURI(serverHostAndPort); addRequestHeader(HttpHeaders.HOST, serverHostAndPort); addRequestHeader(HttpHeaders.PROXY_CONNECTION, "keep-alive"); addRequestHeader(HttpHeaders.USER_AGENT, "Jetty-Client"); diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java index 8ced04a810a..e97cc611654 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java @@ -15,6 +15,7 @@ package org.eclipse.jetty.client; import java.io.IOException; import java.io.InputStream; +import java.net.URI; import java.util.concurrent.atomic.AtomicInteger; import org.eclipse.jetty.client.security.SecurityListener; @@ -38,8 +39,8 @@ import org.eclipse.jetty.util.thread.Timeout; * * This object encapsulates: *
This WebSocket Client class can create multiple websocket connections to multiple destinations. * It uses the same {@link WebSocket} endpoint API as the server. * Simple usage is as follows:
- * WebSocketClient client = new WebSocketClient(); - * client.setMaxIdleTime(500); + * WebSocketClientFactory factory = new WebSocketClientFactory(); + * factory.start(); + * WebSocketClient client = factory.newClient(); * client.start(); * * WebSocket.Connection connection = client.open(new URI("ws://127.0.0.1:8080/"),new WebSocket.OnTextMessage() @@ -69,84 +52,38 @@ import org.eclipse.jetty.websocket.WebSocketGeneratorD12.MaskGen; * connection.sendMessage("Hello World"); **/ -public class WebSocketClient extends AggregateLifeCycle +public class WebSocketClient { private final static Logger __log = org.eclipse.jetty.util.log.Log.getLogger(WebSocketClient.class.getName()); - private final static Random __random = new Random(); - private final static ByteArrayBuffer __ACCEPT = new ByteArrayBuffer.CaseInsensitive("Sec-WebSocket-Accept"); - - private final WebSocketClient _root; - private final WebSocketClient _parent; - private final ThreadPool _threadPool; - private final WebSocketClientSelector _selector; + private final WebSocketClientFactory _factory; private final Map
Creates a WebSocketClient from a private WebSocketClientFactory. This can be wasteful of resources if many clients are created. */ - public WebSocketClient() + public WebSocketClient() throws Exception { - this(new QueuedThreadPool()); + _factory=new WebSocketClientFactory(); + _factory.start(); + _maskGen=_factory.getMaskGen(); } /* ------------------------------------------------------------ */ - /** Create a WebSocket Client with shared threadpool. + /** Create a WebSocket Client with shared factory. * @param threadpool */ - public WebSocketClient(ThreadPool threadpool) + public WebSocketClient(WebSocketClientFactory factory) { - _root=this; - _parent=null; - _threadPool=threadpool; - _selector=new WebSocketClientSelector(); - addBean(_selector); - addBean(_threadPool); - } - - /* ------------------------------------------------------------ */ - /** Create a WebSocket Client from another. - *
If multiple clients are required so that connections created may have different - * configurations, then it is more efficient to create a client based on another, so - * that the thread pool and IO infrastructure may be shared. - */ - public WebSocketClient(WebSocketClient parent) - { - _root=parent._root; - _parent=parent; - _threadPool=parent._threadPool; - _selector=parent._selector; - _parent.addBean(this); - } - - /* ------------------------------------------------------------ */ - /** - * Get the selectorManager. Used to configure the manager. - * @return The {@link SelectorManager} instance. - */ - public SelectorManager getSelectorManager() - { - return _selector; - } - - /* ------------------------------------------------------------ */ - /** Get the ThreadPool. - *
Used to set/query the thread pool configuration.
- * @return The {@link ThreadPool}
- */
- public ThreadPool getThreadPool()
- {
- return _threadPool;
+ _factory=factory;
+ _maskGen=_factory.getMaskGen();
}
/* ------------------------------------------------------------ */
@@ -167,26 +104,6 @@ public class WebSocketClient extends AggregateLifeCycle
_maxIdleTime=maxIdleTime;
}
- /* ------------------------------------------------------------ */
- /** Get the WebSocket Buffer size for connections opened by this client.
- * @return the buffer size in bytes.
- */
- public int getBufferSize()
- {
- return _bufferSize;
- }
-
- /* ------------------------------------------------------------ */
- /** Set the WebSocket Buffer size for connections opened by this client.
- * @param bufferSize the buffer size in bytes.
- */
- public void setBufferSize(int bufferSize)
- {
- if (isRunning())
- throw new IllegalStateException(getState());
- _bufferSize = bufferSize;
- }
-
/* ------------------------------------------------------------ */
/** Get the subprotocol string for connections opened by this client.
* @return The subprotocol
@@ -235,23 +152,16 @@ public class WebSocketClient extends AggregateLifeCycle
return _extensions;
}
-
/* ------------------------------------------------------------ */
- /**
- * @return whether masking is enabled.
- */
- public boolean isMaskingEnabled()
+ public MaskGen getMaskGen()
{
- return _maskingEnabled;
+ return _maskGen;
}
/* ------------------------------------------------------------ */
- /**
- * @param maskingEnabled whether to enable masking
- */
- public void setMaskingEnabled(boolean maskingEnabled)
+ public void setMaskGen(MaskGen maskGen)
{
- _maskingEnabled=maskingEnabled;
+ _maskGen = maskGen;
}
/* ------------------------------------------------------------ */
@@ -297,8 +207,8 @@ public class WebSocketClient extends AggregateLifeCycle
*/
public Future Used to set/query the thread pool configuration.
+ * @return The {@link ThreadPool}
+ */
+ public ThreadPool getThreadPool()
+ {
+ return _threadPool;
+ }
+
+ /* ------------------------------------------------------------ */
+ public MaskGen getMaskGen()
+ {
+ return _maskGen;
+ }
+
+ /* ------------------------------------------------------------ */
+ public WebSocketClient newWebSocketClient()
+ {
+ return new WebSocketClient(this);
+ }
+
+ /* ------------------------------------------------------------ */
+ @Override
+ protected void doStart() throws Exception
+ {
+ super.doStart();
+
+ // Start a selector threads
+ for (int i=0;i<_selector.getSelectSets();i++)
+ {
+ final int id=i;
+ _threadPool.dispatch(new Runnable()
+ {
+ public void run()
+ {
+ while(isRunning())
+ {
+ try
+ {
+ _selector.doSelect(id);
+ }
+ catch (IOException e)
+ {
+ __log.warn(e);
+ }
+ }
+ }
+ });
+ }
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** WebSocket Client Selector Manager
+ */
+ class WebSocketClientSelector extends SelectorManager
+ {
+ @Override
+ public boolean dispatch(Runnable task)
+ {
+ return _threadPool.dispatch(task);
+ }
+
+ @Override
+ protected SelectChannelEndPoint newEndPoint(SocketChannel channel, SelectSet selectSet, final SelectionKey sKey) throws IOException
+ {
+ return new SelectChannelEndPoint(channel,selectSet,sKey);
+ }
+
+ @Override
+ protected Connection newConnection(SocketChannel channel, SelectChannelEndPoint endpoint)
+ {
+ WebSocketClient.WebSocketFuture holder = (WebSocketClient.WebSocketFuture) endpoint.getSelectionKey().attachment();
+ return new HandshakeConnection(endpoint,holder);
+ }
+
+ @Override
+ protected void endPointOpened(SelectChannelEndPoint endpoint)
+ {
+ // TODO expose on outer class ??
+ }
+
+ @Override
+ protected void endPointUpgraded(ConnectedEndPoint endpoint, Connection oldConnection)
+ {
+ throw new IllegalStateException();
+ }
+
+ @Override
+ protected void endPointClosed(SelectChannelEndPoint endpoint)
+ {
+ endpoint.getConnection().closed();
+ }
+
+ @Override
+ protected void connectionFailed(SocketChannel channel, Throwable ex, Object attachment)
+ {
+ if (!(attachment instanceof WebSocketClient.WebSocketFuture))
+ super.connectionFailed(channel,ex,attachment);
+ else
+ {
+ __log.debug(ex);
+ WebSocketClient.WebSocketFuture future = (WebSocketClient.WebSocketFuture)attachment;
+
+ future.handshakeFailed(ex);
+ }
+ }
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** Handshake Connection.
+ * Handles the connection until the handshake succeeds or fails.
+ */
+ class HandshakeConnection extends AbstractConnection
+ {
+ private final SelectChannelEndPoint _endp;
+ private final WebSocketClient.WebSocketFuture _holder;
+ private final String _key;
+ private final HttpParser _parser;
+ private String _accept;
+ private String _error;
+
+ public HandshakeConnection(SelectChannelEndPoint endpoint, WebSocketClient.WebSocketFuture future)
+ {
+ super(endpoint,System.currentTimeMillis());
+ _endp=endpoint;
+ _holder=future;
+
+ byte[] bytes=new byte[16];
+ __random.nextBytes(bytes);
+ _key=new String(B64Code.encode(bytes));
+
+
+ Buffers buffers = new SimpleBuffers(_buffers.getBuffer(),null);
+ _parser=new HttpParser(buffers,_endp,
+
+ new HttpParser.EventHandler()
+ {
+ @Override
+ public void startResponse(Buffer version, int status, Buffer reason) throws IOException
+ {
+ if (status!=101)
+ {
+ _error="Bad response status "+status+" "+reason;
+ _endp.close();
+ }
+ }
+
+ @Override
+ public void parsedHeader(Buffer name, Buffer value) throws IOException
+ {
+ if (__ACCEPT.equals(name))
+ _accept=value.toString();
+ }
+
+ @Override
+ public void startRequest(Buffer method, Buffer url, Buffer version) throws IOException
+ {
+ if (_error==null)
+ _error="Bad response: "+method+" "+url+" "+version;
+ _endp.close();
+ }
+
+ @Override
+ public void content(Buffer ref) throws IOException
+ {
+ if (_error==null)
+ _error="Bad response. "+ref.length()+"B of content?";
+ _endp.close();
+ }
+ });
+
+ String path=_holder.getURI().getPath();
+ if (path==null || path.length()==0)
+ path="/";
+
+ String origin = future.getOrigin();
+
+ String request=
+ "GET "+path+" HTTP/1.1\r\n"+
+ "Host: "+future.getURI().getHost()+":"+_holder.getURI().getPort()+"\r\n"+
+ "Upgrade: websocket\r\n"+
+ "Connection: Upgrade\r\n"+
+ "Sec-WebSocket-Key: "+_key+"\r\n"+
+ (origin==null?"":"Origin: "+origin+"\r\n")+
+ "Sec-WebSocket-Version: "+WebSocketConnectionD12.VERSION+"\r\n";
+
+ if (future.getProtocol()!=null)
+ request+="Sec-WebSocket-Protocol: "+future.getProtocol()+"\r\n";
+
+ if (future.getCookies()!=null && future.getCookies().size()>0)
+ {
+ for (String cookie : future.getCookies().keySet())
+ request+="Cookie: "+QuotedStringTokenizer.quoteIfNeeded(cookie,HttpFields.__COOKIE_DELIM)+
+ "="+
+ QuotedStringTokenizer.quoteIfNeeded(future.getCookies().get(cookie),HttpFields.__COOKIE_DELIM)+
+ "\r\n";
+ }
+
+ request+="\r\n";
+
+ // TODO extensions
+
+ try
+ {
+ Buffer handshake = new ByteArrayBuffer(request,false);
+ int len=handshake.length();
+ if (len!=_endp.flush(handshake))
+ throw new IOException("incomplete");
+ }
+ catch(IOException e)
+ {
+ future.handshakeFailed(e);
+ }
+
+ }
+
+ public Connection handle() throws IOException
+ {
+ while (_endp.isOpen() && !_parser.isComplete())
+ {
+ switch (_parser.parseAvailable())
+ {
+ case -1:
+ _holder.handshakeFailed(new IOException("Incomplete handshake response"));
+ return this;
+ case 0:
+ return this;
+ default:
+ break;
+ }
+ }
+ if (_error==null)
+ {
+ if (_accept==null)
+ _error="No Sec-WebSocket-Accept";
+ else if (!WebSocketConnectionD12.hashKey(_key).equals(_accept))
+ _error="Bad Sec-WebSocket-Accept";
+ else
+ {
+ Buffer header=_parser.getHeaderBuffer();
+ MaskGen maskGen=_holder.getMaskGen();
+ WebSocketConnectionD12 connection = new WebSocketConnectionD12(_holder.getWebSocket(),_endp,_buffers,System.currentTimeMillis(),_holder.getMaxIdleTime(),_holder.getProtocol(),null,10,maskGen);
+
+ if (header.hasContent())
+ connection.fillBuffersFrom(header);
+ _buffers.returnBuffer(header);
+
+ _holder.onConnection(connection);
+
+ return connection;
+ }
+ }
+
+ _endp.close();
+ return this;
+ }
+
+ public boolean isIdle()
+ {
+ return false;
+ }
+
+ public boolean isSuspended()
+ {
+ return false;
+ }
+
+ public void closed()
+ {
+ if (_error!=null)
+ _holder.handshakeFailed(new ProtocolException(_error));
+ else
+ _holder.handshakeFailed(new EOFException());
+ }
+ }
+
+
+
+
+}
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD12.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD12.java
index 06b4b611bd4..f283b887a8b 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD12.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketConnectionD12.java
@@ -38,7 +38,6 @@ import org.eclipse.jetty.websocket.WebSocket.OnBinaryMessage;
import org.eclipse.jetty.websocket.WebSocket.OnControl;
import org.eclipse.jetty.websocket.WebSocket.OnFrame;
import org.eclipse.jetty.websocket.WebSocket.OnTextMessage;
-import org.eclipse.jetty.websocket.WebSocketGeneratorD12.MaskGen;
public class WebSocketConnectionD12 extends AbstractConnection implements WebSocketConnection
{
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
index 2b740101f6c..a181b8cc508 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06.java
@@ -38,61 +38,6 @@ public class WebSocketGeneratorD06 implements WebSocketGenerator
private int _m;
private boolean _opsent;
private final MaskGen _maskGen;
-
- public interface MaskGen
- {
- void genMask(byte[] mask);
- }
-
- public static class NullMaskGen implements MaskGen
- {
- public void genMask(byte[] mask)
- {
- mask[0]=mask[1]=mask[2]=mask[3]=0;
- }
- }
-
- public static class FixedMaskGen implements MaskGen
- {
- final byte[] _mask;
- public FixedMaskGen()
- {
- _mask=new byte[]{(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff};
- }
-
- public FixedMaskGen(byte[] mask)
- {
- _mask=mask;
- }
-
- public void genMask(byte[] mask)
- {
- mask[0]=_mask[0];
- mask[1]=_mask[1];
- mask[2]=_mask[2];
- mask[3]=_mask[3];
- }
- }
-
- public static class RandomMaskGen implements MaskGen
- {
- final Random _random;
- public RandomMaskGen()
- {
- _random=new SecureRandom();
- }
-
- public RandomMaskGen(Random random)
- {
- _random=random;
- }
-
- public void genMask(byte[] mask)
- {
- _random.nextBytes(mask);
- }
- }
-
public WebSocketGeneratorD06(WebSocketBuffers buffers, EndPoint endp)
{
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12.java
index 52b2fe471d7..e0d510c5e92 100644
--- a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12.java
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12.java
@@ -14,7 +14,6 @@
package org.eclipse.jetty.websocket;
import java.io.IOException;
-import java.util.Random;
import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.EndPoint;
@@ -38,61 +37,6 @@ public class WebSocketGeneratorD12 implements WebSocketGenerator
private boolean _opsent;
private final MaskGen _maskGen;
- public interface MaskGen
- {
- void genMask(byte[] mask);
- }
-
- public static class NullMaskGen implements MaskGen
- {
- public void genMask(byte[] mask)
- {
- mask[0]=mask[1]=mask[2]=mask[3]=0;
- }
- }
-
- public static class FixedMaskGen implements MaskGen
- {
- final byte[] _mask;
- public FixedMaskGen()
- {
- _mask=new byte[]{(byte)0xff,(byte)0xff,(byte)0xff,(byte)0xff};
- }
-
- public FixedMaskGen(byte[] mask)
- {
- _mask=mask;
- }
-
- public void genMask(byte[] mask)
- {
- mask[0]=_mask[0];
- mask[1]=_mask[1];
- mask[2]=_mask[2];
- mask[3]=_mask[3];
- }
- }
-
- public static class RandomMaskGen implements MaskGen
- {
- final Random _random;
- public RandomMaskGen()
- {
- _random=new Random();
- }
-
- public RandomMaskGen(Random random)
- {
- _random=random;
- }
-
- public void genMask(byte[] mask)
- {
- _random.nextBytes(mask);
- }
- }
-
-
public WebSocketGeneratorD12(WebSocketBuffers buffers, EndPoint endp)
{
_buffers=buffers;
diff --git a/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java
new file mode 100644
index 00000000000..7cddcc4f59c
--- /dev/null
+++ b/jetty-websocket/src/main/java/org/eclipse/jetty/websocket/ZeroMaskGen.java
@@ -0,0 +1,10 @@
+package org.eclipse.jetty.websocket;
+
+
+public class ZeroMaskGen implements MaskGen
+{
+ public void genMask(byte[] mask)
+ {
+ mask[0]=mask[1]=mask[2]=mask[3]=0;
+ }
+}
\ No newline at end of file
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
index aec12debe2a..cf27beb46c1 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketClientTest.java
@@ -27,28 +27,32 @@ import org.junit.Test;
public class WebSocketClientTest
{
+ private WebSocketClientFactory _factory = new WebSocketClientFactory();
private ServerSocket _server;
private int _serverPort;
@Before
- public void startServer() throws IOException {
+ public void startServer() throws Exception
+ {
_server = new ServerSocket();
_server.bind(null);
_serverPort = _server.getLocalPort();
+ _factory.start();
}
@After
- public void stopServer() throws IOException {
+ public void stopServer() throws Exception
+ {
if(_server != null) {
_server.close();
}
+ _factory.stop();
}
@Test
public void testBadURL() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
boolean bad=false;
final AtomicBoolean open = new AtomicBoolean();
@@ -79,8 +83,7 @@ public class WebSocketClientTest
@Test
public void testAsyncConnectionRefused() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -120,8 +123,7 @@ public class WebSocketClientTest
@Test
public void testConnectionNotAccepted() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -159,8 +161,7 @@ public class WebSocketClientTest
@Test
public void testConnectionTimeout() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -200,8 +201,7 @@ public class WebSocketClientTest
@Test
public void testBadHandshake() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -242,8 +242,7 @@ public class WebSocketClientTest
@Test
public void testBadUpgrade() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -285,8 +284,7 @@ public class WebSocketClientTest
@Test
public void testUpgradeThenTCPClose() throws Exception
{
- WebSocketClient client = new WebSocketClient();
- client.start();
+ WebSocketClient client = new WebSocketClient(_factory);
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -323,9 +321,8 @@ public class WebSocketClientTest
@Test
public void testIdle() throws Exception
{
- WebSocketClient client = new WebSocketClient();
+ WebSocketClient client = new WebSocketClient(_factory);
client.setMaxIdleTime(500);
- client.start();
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
@@ -362,9 +359,8 @@ public class WebSocketClientTest
@Test
public void testNotIdle() throws Exception
{
- WebSocketClient client = new WebSocketClient();
+ WebSocketClient client = new WebSocketClient(_factory);
client.setMaxIdleTime(500);
- client.start();
final AtomicBoolean open = new AtomicBoolean();
final AtomicInteger close = new AtomicInteger();
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
index c7dc3ec5419..f4cc5603071 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD06Test.java
@@ -20,7 +20,7 @@ public class WebSocketGeneratorD06Test
byte[] _mask = new byte[4];
int _m;
- public WebSocketGeneratorD06.MaskGen _maskGen = new WebSocketGeneratorD06.FixedMaskGen(
+ public MaskGen _maskGen = new FixedMaskGen(
new byte[]{(byte)0x00,(byte)0x00,(byte)0x0f,(byte)0xff});
@Before
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12Test.java
index d968a4ea2ec..6d3fb5fb45f 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketGeneratorD12Test.java
@@ -20,7 +20,7 @@ public class WebSocketGeneratorD12Test
byte[] _mask = new byte[4];
int _m;
- public WebSocketGeneratorD12.MaskGen _maskGen = new WebSocketGeneratorD12.FixedMaskGen(
+ public MaskGen _maskGen = new FixedMaskGen(
new byte[]{(byte)0x00,(byte)0x00,(byte)0x0f,(byte)0xff});
@Before
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD12Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD12Test.java
index 053a7fb0323..478e3f3ca5e 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD12Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketLoadD12Test.java
@@ -167,7 +167,7 @@ public class WebSocketLoadD12Test
this.iterations = iterations;
_endp=new SocketEndPoint(socket);
- _generator = new WebSocketGeneratorD12(new WebSocketBuffers(32*1024),_endp,new WebSocketGeneratorD12.FixedMaskGen());
+ _generator = new WebSocketGeneratorD12(new WebSocketBuffers(32*1024),_endp,new FixedMaskGen());
_parser = new WebSocketParserD12(new WebSocketBuffers(32*1024),_endp,_handler,false);
}
diff --git a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
index a8746fca744..1521f1a608b 100644
--- a/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
+++ b/jetty-websocket/src/test/java/org/eclipse/jetty/websocket/WebSocketMessageD06Test.java
@@ -662,7 +662,7 @@ public class WebSocketMessageD06Test
final AtomicReference