activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject [2/3] activemq git commit: https://issues.apache.org/jira/browse/AMQ-5356
Date Thu, 03 Sep 2015 12:52:45 GMT
https://issues.apache.org/jira/browse/AMQ-5356

Upgraded to Jetty 9.2.x to solve JDK 8 compatibility issues.
This required migrating to the new WebSocket API.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/f44c3d20
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/f44c3d20
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/f44c3d20

Branch: refs/heads/master
Commit: f44c3d20ed2a9f74746a02418a4381909936a000
Parents: 505916b
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Wed Aug 19 16:55:14 2015 +0000
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Thu Sep 3 11:54:57 2015 +0000

----------------------------------------------------------------------
 activemq-fileserver/pom.xml                     |  18 +-
 .../src/main/webapp/WEB-INF/web.xml             |   9 +-
 .../apache/activemq/util/HttpTestSupport.java   |   8 +-
 .../apache/activemq/util/RestFilterTest.java    |   4 +-
 activemq-http/pom.xml                           |  11 +-
 .../transport/SecureSocketConnectorFactory.java |  27 +-
 .../transport/SocketConnectorFactory.java       |  15 +-
 .../transport/WebTransportServerSupport.java    |   7 +-
 .../https/Krb5AndCertsSslSocketConnector.java   | 309 ++++++-------
 .../transport/ws/WSTransportServer.java         |  12 +-
 .../transport/ws/jetty8/MQTTSocket.java         |  89 ----
 .../transport/ws/jetty8/StompSocket.java        |  73 ---
 .../activemq/transport/ws/jetty8/WSServlet.java |  66 ---
 .../transport/ws/jetty9/MQTTSocket.java         |   2 +
 .../activemq/transport/ws/jetty9/WSServlet.java |   7 +-
 .../activemq/transport/ws/MQTTWSConnection.java |  57 ++-
 .../ws/MQTTWSConnectionTimeoutTest.java         |  21 +-
 .../transport/ws/MQTTWSLinkStealingTest.java    |  21 +-
 .../transport/ws/MQTTWSTransportTest.java       |  17 +-
 .../activemq/transport/ws/SocketTest.java       |  11 +-
 .../transport/ws/StompWSConnection.java         |  44 +-
 .../ws/StompWSConnectionTimeoutTest.java        |  15 +-
 .../transport/ws/StompWSTransportTest.java      |  13 +-
 .../activemq/transport/ws/WSTransportTest.java  |   3 -
 .../transport/ws/WSTransportTestSupport.java    |   9 +-
 .../transport/wss/WSSTransportTest.java         |   7 +-
 activemq-http/src/webapp/WEB-INF/web.xml        |  13 +-
 activemq-osgi/pom.xml                           |   2 +-
 activemq-web-console/pom.xml                    |  78 +++-
 .../src/main/webapp/WEB-INF/activemq.xml        |   2 +-
 .../src/main/webapp/WEB-INF/web.xml             |   9 +-
 .../java/org/apache/activemq/web/tool/Main.java |  18 +-
 activemq-web-demo/pom.xml                       |   5 +-
 .../src/main/webapp/WEB-INF/web.xml             |  18 +-
 .../java/org/apache/activemq/web/AjaxTest.java  | 457 ++++++++-----------
 .../org/apache/activemq/web/JettyServer.java    |   7 +-
 .../apache/activemq/web/JettyTestSupport.java   |  10 +-
 .../apache/activemq/web/RestPersistentTest.java |  75 ++-
 .../java/org/apache/activemq/web/RestTest.java  | 250 ++++++----
 activemq-web/pom.xml                            |  17 +-
 .../activemq/web/config/JspConfigurer.java      |  50 ++
 assembly/pom.xml                                |  43 +-
 assembly/src/main/descriptors/common-bin.xml    |  22 +-
 assembly/src/release/conf/jetty.xml             | 142 +++---
 .../src/release/examples/conf/jetty-demo.xml    | 153 ++++---
 .../src/release/webapps/api/WEB-INF/web.xml     |  14 +-
 pom.xml                                         |  74 ++-
 47 files changed, 1170 insertions(+), 1164 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-fileserver/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-fileserver/pom.xml b/activemq-fileserver/pom.xml
index 7f6dc02..65feb30 100755
--- a/activemq-fileserver/pom.xml
+++ b/activemq-fileserver/pom.xml
@@ -33,12 +33,11 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.mortbay.jetty</groupId>
+        <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-maven-plugin</artifactId>
-        <version>${jetty-version}</version>
         <configuration>
           <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <connector implementation="org.eclipse.jetty.server.ServerConnector">
               <port>${jetty.port}</port>
               <maxIdleTime>60000</maxIdleTime>
             </connector>
@@ -63,12 +62,13 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
 
-    <!-- web container -->
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-servlet_3.0_spec</artifactId>
-      <scope>provided</scope>
-    </dependency>
+	<!-- web container -->
+	<dependency>
+		<groupId>org.apache.tomcat</groupId>
+		<artifactId>tomcat-servlet-api</artifactId>
+		<scope>provided</scope>
+	</dependency>
+
 
     <!-- used for testing -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-fileserver/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/activemq-fileserver/src/main/webapp/WEB-INF/web.xml b/activemq-fileserver/src/main/webapp/WEB-INF/web.xml
index 372ec1c..e3d3bed 100644
--- a/activemq-fileserver/src/main/webapp/WEB-INF/web.xml
+++ b/activemq-fileserver/src/main/webapp/WEB-INF/web.xml
@@ -15,11 +15,10 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!DOCTYPE web-app 
-    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
-    "http://java.sun.com/dtd/web-app_2_3.dtd">
-    
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+      version="3.0"> 
 
   <display-name>RESTful file access application</display-name>
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java b/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java
index 6ea0a25..32017b6 100644
--- a/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java
+++ b/activemq-fileserver/src/test/java/org/apache/activemq/util/HttpTestSupport.java
@@ -30,9 +30,7 @@ import junit.framework.TestCase;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.eclipse.jetty.webapp.WebAppContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,8 +49,8 @@ public abstract class HttpTestSupport extends TestCase {
     protected boolean createBroker = true;
 
     final File homeDir = new File("src/main/webapp/uploads/");
+    int port;
 
-    
     private int getPort(Object o) throws Exception {
         return (Integer)o.getClass().getMethod("getLocalPort").invoke(o);
     }
@@ -68,7 +66,7 @@ public abstract class HttpTestSupport extends TestCase {
         server.setHandler(context);
         server.start();
 
-        int port = getPort(server.getConnectors()[0]);
+        port = getPort(server.getConnectors()[0]);
 
         waitForJettySocketToAccept("http://localhost:" + port);
 
@@ -93,6 +91,8 @@ public abstract class HttpTestSupport extends TestCase {
         }
     }
 
+
+
     @Override
     protected void tearDown() throws Exception {
         server.stop();

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
----------------------------------------------------------------------
diff --git a/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java b/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
index 7e2b799..5422694 100644
--- a/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
+++ b/activemq-fileserver/src/test/java/org/apache/activemq/util/RestFilterTest.java
@@ -28,12 +28,12 @@ import org.eclipse.jetty.util.IO;
 public class RestFilterTest extends HttpTestSupport {
 
     protected boolean createBroker = false;
-    
+
     public void testFilter() throws Exception {
         byte[] fileContents = new byte[] {
             'a', 'b', 'c'
         };
-        URL url = new URL("http://localhost:8080/uploads/file.txt");
+        URL url = new URL("http://localhost:" + port + "/uploads/file.txt");
 
         // 1. upload
         HttpURLConnection connection = (HttpURLConnection)url.openConnection();

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-http/pom.xml b/activemq-http/pom.xml
index 7d00276..ee8c480 100755
--- a/activemq-http/pom.xml
+++ b/activemq-http/pom.xml
@@ -39,6 +39,10 @@
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
     </dependency>
+     <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-jms</artifactId>
+    </dependency>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>activemq-stomp</artifactId>
@@ -111,11 +115,10 @@
     <dependency>
       <groupId>org.eclipse.jetty.websocket</groupId>
       <artifactId>websocket-server</artifactId>
-      <version>${jetty9-version}</version>
       <scope>provided</scope>
       <optional>true</optional>
-  </dependency>
-  <dependency>
+    </dependency>
+   <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
       <scope>test</scope>
@@ -143,7 +146,7 @@
               org.apache.activemq.transport.https*;version=${project.version};-noimport:=;-split-package:=merge-last
             </Export-Package>
             <Import-Package>
-              org.eclipse.jetty*;version="[7.5,8.0)";resolution:=optional,
+              org.eclipse.jetty*;version="[9.0,10.0)";resolution:=optional,
               !org.apache.activemq.transport.ws*;version=${project.version},
               !org.apache.activemq.transport.xstream;version=${project.version},
               !org.apache.activemq.transport.util;version=${project.version},

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java b/activemq-http/src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java
index 3ac922a..3fd27f1 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/SecureSocketConnectorFactory.java
@@ -19,10 +19,10 @@ package org.apache.activemq.transport;
 import javax.net.ssl.SSLContext;
 
 import org.apache.activemq.broker.SslContext;
-import org.apache.activemq.transport.https.Krb5AndCertsSslSocketConnector;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.util.ssl.SslContextFactory;
 
 public class SecureSocketConnectorFactory extends SocketConnectorFactory {
@@ -43,9 +43,9 @@ public class SecureSocketConnectorFactory extends SocketConnectorFactory {
 
     private SslContext context;
     private SslContextFactory contextFactory;
-    
+
     public SecureSocketConnectorFactory() {
-        
+
     }
     public SecureSocketConnectorFactory(SslContext context) {
         this.context = context;
@@ -113,21 +113,16 @@ public class SecureSocketConnectorFactory extends SocketConnectorFactory {
             factory = contextFactory;
         }
 
-        
+
         if ("KRB".equals(auth) || "BOTH".equals(auth)
             && Server.getVersion().startsWith("8")) {
-            return new Krb5AndCertsSslSocketConnector(factory, auth);
+            //return new Krb5AndCertsSslSocketConnector(factory, auth);
+            return null;
         } else {
-            try {
-                Class<?> cls = Class.forName("org.eclipse.jetty.server.ssl.SslSelectChannelConnector", true, Server.class.getClassLoader());
-                return (Connector)cls.getConstructor(SslContextFactory.class).newInstance(factory);
-            } catch (Throwable t) {
-                Class<?> c = Class.forName("org.eclipse.jetty.server.ServerConnector", true, Server.class.getClassLoader());
-                Connector connector = (Connector)c.getConstructor(Server.class, SslContextFactory.class).newInstance(server, factory);
-                Server.class.getMethod("setStopTimeout", Long.TYPE).invoke(server, 500);
-                connector.getClass().getMethod("setStopTimeout", Long.TYPE).invoke(connector, 500);
-                return connector;
-            }
+            ServerConnector connector = new ServerConnector(server, factory);
+            server.setStopTimeout(500);
+            connector.setStopTimeout(500);
+            return connector;
         }
     }
     private void setTrustStore(SslContextFactory factory, String trustStore2) throws Exception {
@@ -136,7 +131,7 @@ public class SecureSocketConnectorFactory extends SocketConnectorFactory {
     }
 
 
-    
+
     // Properties
     // --------------------------------------------------------------------------------
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java b/activemq-http/src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java
index b982f18..03c574d 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/SocketConnectorFactory.java
@@ -21,23 +21,16 @@ import java.util.Map;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 
 public class SocketConnectorFactory {
 
     private Map<String, Object> transportOptions;
 
     public Connector createConnector(Server server) throws Exception {
-        Connector connector = null;
-        
-        try {
-            connector = (Connector)Class.forName("org.eclipse.jetty.server.nio.SelectChannelConnector", true, Server.class.getClassLoader()).newInstance();
-        } catch (Throwable t) {
-            Class<?> c = Class.forName("org.eclipse.jetty.server.ServerConnector", true, Server.class.getClassLoader());
-            connector = (Connector)c.getConstructor(Server.class).newInstance(server);
-            Server.class.getMethod("setStopTimeout", Long.TYPE).invoke(server, 500);
-            connector.getClass().getMethod("setStopTimeout", Long.TYPE).invoke(connector, 500);
-        }
-        System.out.println(transportOptions);
+        ServerConnector connector = new ServerConnector(server);
+        server.setStopTimeout(500);
+        connector.setStopTimeout(500);
         if (transportOptions != null) {
             IntrospectionSupport.setProperties(connector, transportOptions, "");
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java b/activemq-http/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
index a52424e..4b2adcb 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/WebTransportServerSupport.java
@@ -38,13 +38,13 @@ abstract public class WebTransportServerSupport extends TransportServerSupport {
     private <T> void setConnectorProperty(String name, Class<T> type, T value) throws Exception {
         connector.getClass().getMethod("set" + name, type).invoke(connector, value);
     }
-    
+
     protected void createServer() {
         server = new Server();
         try {
             server.getClass().getMethod("setStopTimeout", Long.TYPE).invoke(server, 500l);
         } catch (Throwable t) {
-            //ignore, jetty 8.  
+            //ignore, jetty 8.
         }
     }
     public URI bind() throws Exception {
@@ -58,9 +58,6 @@ abstract public class WebTransportServerSupport extends TransportServerSupport {
 
         setConnectorProperty("Host", String.class, host);
         setConnectorProperty("Port", Integer.TYPE, bindAddress.getPort());
-        if (Server.getVersion().startsWith("8")) {
-            connector.setServer(server);
-        }
         server.addConnector(connector);
         if (addr.isAnyLocalAddress()) {
             host = InetAddressUtil.getLocalHostName();

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/https/Krb5AndCertsSslSocketConnector.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/https/Krb5AndCertsSslSocketConnector.java b/activemq-http/src/main/java/org/apache/activemq/transport/https/Krb5AndCertsSslSocketConnector.java
index cf36122..aacf897 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/https/Krb5AndCertsSslSocketConnector.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/https/Krb5AndCertsSslSocketConnector.java
@@ -16,27 +16,6 @@
  */
 package org.apache.activemq.transport.https;
 
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.security.NoSuchProviderException;
-import java.security.Principal;
-import java.util.Collections;
-import java.util.List;
-import java.util.Random;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLServerSocket;
-import javax.net.ssl.SSLSocket;
-
-import org.eclipse.jetty.http.HttpSchemes;
-import org.eclipse.jetty.io.EndPoint;
-import org.eclipse.jetty.server.Request;
-import org.eclipse.jetty.server.ssl.ServletSSL;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Extend Jetty's {@link SslSocketConnector} to optionally also provide
@@ -44,147 +23,149 @@ import org.slf4j.LoggerFactory;
  * that we no longer honor requests to turn off NeedAuthentication when running
  * with Kerberos support.
  */
-public class Krb5AndCertsSslSocketConnector extends SslSocketConnector {
-    public static final List<String> KRB5_CIPHER_SUITES = Collections.unmodifiableList(Collections.singletonList("TLS_KRB5_WITH_3DES_EDE_CBC_SHA"));
-    static {
-        System.setProperty("https.cipherSuites", KRB5_CIPHER_SUITES.get(0));
-    }
-
-    private static final Logger LOG = LoggerFactory.getLogger(Krb5AndCertsSslSocketConnector.class);
-
-    private static final String REMOTE_PRINCIPAL = "remote_principal";
-
-    public enum MODE {
-        KRB, CERTS, BOTH
-    } // Support Kerberos, certificates or both?
-
-    private boolean useKrb;
-    private boolean useCerts;
-
-    public Krb5AndCertsSslSocketConnector() {
-        // By default, stick to cert based authentication
-        super();
-        useKrb = false;
-        useCerts = true;
-        setPasswords();
-    }
-    public Krb5AndCertsSslSocketConnector(SslContextFactory f, String auth) {
-        // By default, stick to cert based authentication
-        super(f);
-        useKrb = false;
-        useCerts = true;
-        setPasswords();
-        setMode(auth);
-    }
-
-    public static boolean isKrb(String mode) {
-        return mode == MODE.KRB.toString() || mode == MODE.BOTH.toString();
-    }
-
-    public void setMode(String mode) {
-        useKrb = mode == MODE.KRB.toString() || mode == MODE.BOTH.toString();
-        useCerts = mode == MODE.CERTS.toString() || mode == MODE.BOTH.toString();
-        logIfDebug("useKerb = " + useKrb + ", useCerts = " + useCerts);
-    }
-
-    // If not using Certs, set passwords to random gibberish or else
-    // Jetty will actually prompt the user for some.
-    private void setPasswords() {
-        if (!useCerts) {
-            Random r = new Random();
-            System.setProperty("jetty.ssl.password", String.valueOf(r.nextLong()));
-            System.setProperty("jetty.ssl.keypassword", String.valueOf(r.nextLong()));
-        }
-    }
-
-    @Override
-    public SslContextFactory getSslContextFactory() {
-        final SslContextFactory factory = super.getSslContextFactory();
-
-        if (useCerts) {
-            return factory;
-        }
-
-        try {
-            SSLContext context = factory.getProvider() == null ? SSLContext.getInstance(factory.getProtocol()) : SSLContext.getInstance(factory.getProtocol(),
-                factory.getProvider());
-            context.init(null, null, null);
-            factory.setSslContext(context);
-        } catch (NoSuchAlgorithmException e) {
-        } catch (NoSuchProviderException e) {
-        } catch (KeyManagementException e) {
-        }
-
-        return factory;
-    }
-
-    /*
-     * (non-Javadoc)
-     *
-     * @see
-     * org.mortbay.jetty.security.SslSocketConnector#newServerSocket(java.lang
-     * .String, int, int)
-     */
-    @Override
-    protected ServerSocket newServerSocket(String host, int port, int backlog) throws IOException {
-        logIfDebug("Creating new KrbServerSocket for: " + host);
-        SSLServerSocket ss = null;
-
-        if (useCerts) // Get the server socket from the SSL super impl
-            ss = (SSLServerSocket) super.newServerSocket(host, port, backlog);
-        else { // Create a default server socket
-            try {
-                ss = (SSLServerSocket) super.newServerSocket(host, port, backlog);
-            } catch (Exception e) {
-                LOG.warn("Could not create KRB5 Listener", e);
-                throw new IOException("Could not create KRB5 Listener: " + e.toString());
-            }
-        }
-
-        // Add Kerberos ciphers to this socket server if needed.
-        if (useKrb) {
-            ss.setNeedClientAuth(true);
-            String[] combined;
-            if (useCerts) { // combine the cipher suites
-                String[] certs = ss.getEnabledCipherSuites();
-                combined = new String[certs.length + KRB5_CIPHER_SUITES.size()];
-                System.arraycopy(certs, 0, combined, 0, certs.length);
-                System.arraycopy(KRB5_CIPHER_SUITES.toArray(new String[0]), 0, combined, certs.length, KRB5_CIPHER_SUITES.size());
-            } else { // Just enable Kerberos auth
-                combined = KRB5_CIPHER_SUITES.toArray(new String[0]);
-            }
-
-            ss.setEnabledCipherSuites(combined);
-        }
-        return ss;
-    };
-
-    @Override
-    public void customize(EndPoint endpoint, Request request) throws IOException {
-        if (useKrb) { // Add Kerberos-specific info
-            SSLSocket sslSocket = (SSLSocket) endpoint.getTransport();
-            Principal remotePrincipal = sslSocket.getSession().getPeerPrincipal();
-            logIfDebug("Remote principal = " + remotePrincipal);
-            request.setScheme(HttpSchemes.HTTPS);
-            request.setAttribute(REMOTE_PRINCIPAL, remotePrincipal);
-
-            if (!useCerts) { // Add extra info that would have been added by
-                             // super
-                String cipherSuite = sslSocket.getSession().getCipherSuite();
-                Integer keySize = Integer.valueOf(ServletSSL.deduceKeyLength(cipherSuite));
-                ;
-
-                request.setAttribute("javax.servlet.request.cipher_suite", cipherSuite);
-                request.setAttribute("javax.servlet.request.key_size", keySize);
-            }
-        }
-
-        if (useCerts)
-            super.customize(endpoint, request);
-    }
-
-    private void logIfDebug(String s) {
-        if (LOG.isDebugEnabled())
-            LOG.debug(s);
-    }
+public class Krb5AndCertsSslSocketConnector {
+//
+//extends SslSocketConnector {
+//    public static final List<String> KRB5_CIPHER_SUITES = Collections.unmodifiableList(Collections.singletonList("TLS_KRB5_WITH_3DES_EDE_CBC_SHA"));
+//    static {
+//        System.setProperty("https.cipherSuites", KRB5_CIPHER_SUITES.get(0));
+//    }
+//
+//    private static final Logger LOG = LoggerFactory.getLogger(Krb5AndCertsSslSocketConnector.class);
+//
+//    private static final String REMOTE_PRINCIPAL = "remote_principal";
+//
+//    public enum MODE {
+//        KRB, CERTS, BOTH
+//    } // Support Kerberos, certificates or both?
+//
+//    private boolean useKrb;
+//    private boolean useCerts;
+//
+//    public Krb5AndCertsSslSocketConnector() {
+//        // By default, stick to cert based authentication
+//        super();
+//        useKrb = false;
+//        useCerts = true;
+//        setPasswords();
+//    }
+//    public Krb5AndCertsSslSocketConnector(SslContextFactory f, String auth) {
+//        // By default, stick to cert based authentication
+//        super(f);
+//        useKrb = false;
+//        useCerts = true;
+//        setPasswords();
+//        setMode(auth);
+//    }
+//
+//    public static boolean isKrb(String mode) {
+//        return mode == MODE.KRB.toString() || mode == MODE.BOTH.toString();
+//    }
+//
+//    public void setMode(String mode) {
+//        useKrb = mode == MODE.KRB.toString() || mode == MODE.BOTH.toString();
+//        useCerts = mode == MODE.CERTS.toString() || mode == MODE.BOTH.toString();
+//        logIfDebug("useKerb = " + useKrb + ", useCerts = " + useCerts);
+//    }
+//
+//    // If not using Certs, set passwords to random gibberish or else
+//    // Jetty will actually prompt the user for some.
+//    private void setPasswords() {
+//        if (!useCerts) {
+//            Random r = new Random();
+//            System.setProperty("jetty.ssl.password", String.valueOf(r.nextLong()));
+//            System.setProperty("jetty.ssl.keypassword", String.valueOf(r.nextLong()));
+//        }
+//    }
+//
+//    @Override
+//    public SslContextFactory getSslContextFactory() {
+//        final SslContextFactory factory = super.getSslContextFactory();
+//
+//        if (useCerts) {
+//            return factory;
+//        }
+//
+//        try {
+//            SSLContext context = factory.getProvider() == null ? SSLContext.getInstance(factory.getProtocol()) : SSLContext.getInstance(factory.getProtocol(),
+//                factory.getProvider());
+//            context.init(null, null, null);
+//            factory.setSslContext(context);
+//        } catch (NoSuchAlgorithmException e) {
+//        } catch (NoSuchProviderException e) {
+//        } catch (KeyManagementException e) {
+//        }
+//
+//        return factory;
+//    }
+//
+//    /*
+//     * (non-Javadoc)
+//     *
+//     * @see
+//     * org.mortbay.jetty.security.SslSocketConnector#newServerSocket(java.lang
+//     * .String, int, int)
+//     */
+//    @Override
+//    protected ServerSocket newServerSocket(String host, int port, int backlog) throws IOException {
+//        logIfDebug("Creating new KrbServerSocket for: " + host);
+//        SSLServerSocket ss = null;
+//
+//        if (useCerts) // Get the server socket from the SSL super impl
+//            ss = (SSLServerSocket) super.newServerSocket(host, port, backlog);
+//        else { // Create a default server socket
+//            try {
+//                ss = (SSLServerSocket) super.newServerSocket(host, port, backlog);
+//            } catch (Exception e) {
+//                LOG.warn("Could not create KRB5 Listener", e);
+//                throw new IOException("Could not create KRB5 Listener: " + e.toString());
+//            }
+//        }
+//
+//        // Add Kerberos ciphers to this socket server if needed.
+//        if (useKrb) {
+//            ss.setNeedClientAuth(true);
+//            String[] combined;
+//            if (useCerts) { // combine the cipher suites
+//                String[] certs = ss.getEnabledCipherSuites();
+//                combined = new String[certs.length + KRB5_CIPHER_SUITES.size()];
+//                System.arraycopy(certs, 0, combined, 0, certs.length);
+//                System.arraycopy(KRB5_CIPHER_SUITES.toArray(new String[0]), 0, combined, certs.length, KRB5_CIPHER_SUITES.size());
+//            } else { // Just enable Kerberos auth
+//                combined = KRB5_CIPHER_SUITES.toArray(new String[0]);
+//            }
+//
+//            ss.setEnabledCipherSuites(combined);
+//        }
+//        return ss;
+//    };
+//
+//    @Override
+//    public void customize(EndPoint endpoint, Request request) throws IOException {
+//        if (useKrb) { // Add Kerberos-specific info
+//            SSLSocket sslSocket = (SSLSocket) endpoint.getTransport();
+//            Principal remotePrincipal = sslSocket.getSession().getPeerPrincipal();
+//            logIfDebug("Remote principal = " + remotePrincipal);
+//            request.setScheme(HttpSchemes.HTTPS);
+//            request.setAttribute(REMOTE_PRINCIPAL, remotePrincipal);
+//
+//            if (!useCerts) { // Add extra info that would have been added by
+//                             // super
+//                String cipherSuite = sslSocket.getSession().getCipherSuite();
+//                Integer keySize = Integer.valueOf(ServletSSL.deduceKeyLength(cipherSuite));
+//                ;
+//
+//                request.setAttribute("javax.servlet.request.cipher_suite", cipherSuite);
+//                request.setAttribute("javax.servlet.request.key_size", keySize);
+//            }
+//        }
+//
+//        if (useCerts)
+//            super.customize(endpoint, request);
+//    }
+//
+//    private void logIfDebug(String s) {
+//        if (LOG.isDebugEnabled())
+//            LOG.debug(s);
+//    }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
index adfa2af..487879f 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/WSTransportServer.java
@@ -26,6 +26,7 @@ import javax.servlet.Servlet;
 import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.transport.SocketConnectorFactory;
 import org.apache.activemq.transport.WebTransportServerSupport;
+import org.apache.activemq.transport.ws.jetty9.WSServlet;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.ServiceStopper;
 import org.eclipse.jetty.server.Connector;
@@ -81,7 +82,7 @@ public class WSTransportServer extends WebTransportServerSupport {
         // Update the Connect To URI with our actual location in case the configured port
         // was set to zero so that we report the actual port we are listening on.
 
-        int port = getConnectorLocalPort(); 
+        int port = getConnectorLocalPort();
         if (port == -1) {
             port = boundTo.getPort();
         }
@@ -98,18 +99,13 @@ public class WSTransportServer extends WebTransportServerSupport {
     }
 
     private Servlet createWSServlet() throws Exception {
-        if (Server.getVersion().startsWith("9")) {
-            return (Servlet)Class.forName("org.apache.activemq.transport.ws.jetty9.WSServlet", true,
-                                          getClass().getClassLoader()).newInstance();
-        }
-        return (Servlet)Class.forName("org.apache.activemq.transport.ws.jetty8.WSServlet", true,
-                                      getClass().getClassLoader()).newInstance();
+        return new WSServlet();
     }
 
     private int getConnectorLocalPort() throws Exception {
         return (Integer)connector.getClass().getMethod("getLocalPort").invoke(connector);
     }
-    
+
     @Override
     protected void doStop(ServiceStopper stopper) throws Exception {
         Server temp = server;

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/MQTTSocket.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/MQTTSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/MQTTSocket.java
deleted file mode 100644
index 7032b1f..0000000
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/MQTTSocket.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.transport.ws.jetty8;
-
-import java.io.IOException;
-
-import org.apache.activemq.transport.ws.AbstractMQTTSocket;
-import org.apache.activemq.util.ByteSequence;
-import org.apache.activemq.util.IOExceptionSupport;
-import org.eclipse.jetty.websocket.WebSocket;
-import org.fusesource.mqtt.codec.DISCONNECT;
-import org.fusesource.mqtt.codec.MQTTFrame;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MQTTSocket extends AbstractMQTTSocket implements WebSocket.OnBinaryMessage {
-
-    private static final Logger LOG = LoggerFactory.getLogger(MQTTSocket.class);
-
-    private Connection outbound;
-
-    public MQTTSocket(String remoteAddress) {
-        super(remoteAddress);
-    }
-
-    @Override
-    public void sendToMQTT(MQTTFrame command) throws IOException {
-        ByteSequence bytes = wireFormat.marshal(command);
-        outbound.sendMessage(bytes.getData(), 0, bytes.getLength());
-    }
-
-    @Override
-    public void handleStopped() throws IOException {
-        if (outbound != null && outbound.isOpen()) {
-            outbound.close();
-        }
-    }
-
-    //----- WebSocket.OnTextMessage callback handlers ------------------------//
-
-    @Override
-    public void onOpen(Connection connection) {
-        this.outbound = connection;
-    }
-
-    @Override
-    public void onMessage(byte[] bytes, int offset, int length) {
-        if (!transportStartedAtLeastOnce()) {
-            LOG.debug("Waiting for MQTTSocket to be properly started...");
-            try {
-                socketTransportStarted.await();
-            } catch (InterruptedException e) {
-                LOG.warn("While waiting for MQTTSocket to be properly started, we got interrupted!! Should be okay, but you could see race conditions...");
-            }
-        }
-
-        receiveCounter += length;
-
-        try {
-            MQTTFrame frame = (MQTTFrame)wireFormat.unmarshal(new ByteSequence(bytes, offset, length));
-            getProtocolConverter().onMQTTCommand(frame);
-        } catch (Exception e) {
-            onException(IOExceptionSupport.create(e));
-        }
-    }
-
-    @Override
-    public void onClose(int closeCode, String message) {
-        try {
-            getProtocolConverter().onMQTTCommand(new DISCONNECT().encode());
-        } catch (Exception e) {
-            LOG.warn("Failed to close WebSocket", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java
deleted file mode 100644
index a2d07b9..0000000
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/StompSocket.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.transport.ws.jetty8;
-
-import java.io.IOException;
-
-import org.apache.activemq.transport.stomp.Stomp;
-import org.apache.activemq.transport.stomp.StompFrame;
-import org.apache.activemq.transport.ws.AbstractStompSocket;
-import org.eclipse.jetty.websocket.WebSocket;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Implements web socket and mediates between servlet and the broker
- */
-public class StompSocket extends AbstractStompSocket implements WebSocket.OnTextMessage {
-
-    private static final Logger LOG = LoggerFactory.getLogger(StompSocket.class);
-
-    private Connection outbound;
-
-    public StompSocket(String remoteAddress) {
-        super(remoteAddress);
-    }
-
-    @Override
-    public void handleStopped() throws IOException {
-        if (outbound != null && outbound.isOpen()) {
-            outbound.close();
-        }
-    }
-
-    @Override
-    public void sendToStomp(StompFrame command) throws IOException {
-        outbound.sendMessage(command.format());
-    }
-
-    //----- WebSocket.OnTextMessage callback handlers ------------------------//
-
-    @Override
-    public void onOpen(Connection connection) {
-        this.outbound = connection;
-    }
-
-    @Override
-    public void onClose(int closeCode, String message) {
-        try {
-            protocolConverter.onStompCommand(new StompFrame(Stomp.Commands.DISCONNECT));
-        } catch (Exception e) {
-            LOG.warn("Failed to close WebSocket", e);
-        }
-    }
-
-    @Override
-    public void onMessage(String data) {
-        processStompFrame(data);
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/WSServlet.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/WSServlet.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/WSServlet.java
deleted file mode 100644
index 91a4c32..0000000
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty8/WSServlet.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activemq.transport.ws.jetty8;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.TransportAcceptListener;
-import org.apache.activemq.transport.util.HttpTransportUtils;
-import org.eclipse.jetty.websocket.WebSocket;
-import org.eclipse.jetty.websocket.WebSocketServlet;
-
-/**
- * Handle connection upgrade requests and creates web sockets
- */
-public class WSServlet extends WebSocketServlet {
-
-    private static final long serialVersionUID = -4716657876092884139L;
-
-    private TransportAcceptListener listener;
-
-    @Override
-    public void init() throws ServletException {
-        super.init();
-        listener = (TransportAcceptListener) getServletContext().getAttribute("acceptListener");
-        if (listener == null) {
-            throw new ServletException("No such attribute 'acceptListener' available in the ServletContext");
-        }
-    }
-
-    @Override
-    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        getServletContext().getNamedDispatcher("default").forward(request, response);
-    }
-
-    @Override
-    public WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
-        WebSocket socket;
-
-        if (protocol != null && protocol.startsWith("mqtt")) {
-            socket = new MQTTSocket(HttpTransportUtils.generateWsRemoteAddress(request));
-        } else {
-            socket = new StompSocket(HttpTransportUtils.generateWsRemoteAddress(request));
-        }
-        listener.onAccept((Transport) socket);
-        return socket;
-    }
-}

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java
index dc49da7..b2dd9be 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java
@@ -65,6 +65,8 @@ public class MQTTSocket extends AbstractMQTTSocket implements WebSocketListener
             }
         }
 
+        receiveCounter += length;
+
         try {
             MQTTFrame frame = (MQTTFrame)wireFormat.unmarshal(new ByteSequence(bytes, offset, length));
             getProtocolConverter().onMQTTCommand(frame);

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java
index 7684318..f84f02c 100644
--- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java
+++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/WSServlet.java
@@ -62,7 +62,12 @@ public class WSServlet extends WebSocketServlet {
             @Override
             public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {
                 WebSocketListener socket;
-                if (req.getSubProtocols().contains("mqtt")) {
+                boolean isMqtt = false;
+                for (String subProtocol : req.getSubProtocols()) {
+                    subProtocol.startsWith("mqtt");
+                    isMqtt = true;
+                }
+                if (isMqtt) {
                     socket = new MQTTSocket(HttpTransportUtils.generateWsRemoteAddress(req.getHttpServletRequest()));
                     resp.setAcceptedSubProtocol("mqtt");
                 } else {

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnection.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnection.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnection.java
index 81788b7..30fc0a6 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnection.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnection.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.transport.ws;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
 import java.util.UUID;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.CountDownLatch;
@@ -25,7 +26,9 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.transport.mqtt.MQTTWireFormat;
 import org.apache.activemq.util.ByteSequence;
-import org.eclipse.jetty.websocket.WebSocket;
+import org.eclipse.jetty.websocket.api.Session;
+import org.eclipse.jetty.websocket.api.WebSocketAdapter;
+import org.eclipse.jetty.websocket.api.WebSocketListener;
 import org.fusesource.hawtbuf.UTF8Buffer;
 import org.fusesource.mqtt.codec.CONNACK;
 import org.fusesource.mqtt.codec.CONNECT;
@@ -45,13 +48,13 @@ import org.slf4j.LoggerFactory;
 /**
  * Implements a simple WebSocket based MQTT Client that can be used for unit testing.
  */
-public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
+public class MQTTWSConnection extends WebSocketAdapter implements WebSocketListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(MQTTWSConnection.class);
 
     private static final MQTTFrame PING_RESP_FRAME = new PINGRESP().encode();
 
-    private Connection connection;
+    private Session connection;
     private final CountDownLatch connectLatch = new CountDownLatch(1);
     private final MQTTWireFormat wireFormat = new MQTTWireFormat();
 
@@ -60,6 +63,7 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
     private int closeCode = -1;
     private String closeMessage;
 
+    @Override
     public boolean isConnected() {
         return connection != null ? connection.isOpen() : false;
     }
@@ -87,7 +91,7 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
         command.keepAlive((short) 0);
 
         ByteSequence payload = wireFormat.marshal(command.encode());
-        connection.sendMessage(payload.data, 0, payload.length);
+        connection.getRemote().sendBytes(ByteBuffer.wrap(payload.data));
 
         MQTTFrame incoming = receive(15, TimeUnit.SECONDS);
         if (incoming == null || incoming.messageType() != CONNACK.TYPE) {
@@ -102,7 +106,7 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
 
         DISCONNECT command = new DISCONNECT();
         ByteSequence payload = wireFormat.marshal(command.encode());
-        connection.sendMessage(payload.data, 0, payload.length);
+        connection.getRemote().sendBytes(ByteBuffer.wrap(payload.data));
     }
 
     //---- Send methods ------------------------------------------------------//
@@ -110,13 +114,13 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
     public void sendFrame(MQTTFrame frame) throws Exception {
         checkConnected();
         ByteSequence payload = wireFormat.marshal(frame);
-        connection.sendMessage(payload.data, 0, payload.length);
+        connection.getRemote().sendBytes(ByteBuffer.wrap(payload.data));
     }
 
     public void keepAlive() throws Exception {
         checkConnected();
         ByteSequence payload = wireFormat.marshal(new PINGREQ().encode());
-        connection.sendMessage(payload.data, 0, payload.length);
+        connection.getRemote().sendBytes(ByteBuffer.wrap(payload.data));
     }
 
     //----- Receive methods --------------------------------------------------//
@@ -159,7 +163,7 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
     //----- WebSocket callback handlers --------------------------------------//
 
     @Override
-    public void onMessage(byte[] data, int offset, int length) {
+    public void onWebSocketBinary(byte[] data, int offset, int length) {
         if (data ==null || length <= 0) {
             return;
         }
@@ -228,26 +232,35 @@ public class MQTTWSConnection implements WebSocket, WebSocket.OnBinaryMessage {
         }
     }
 
-    @Override
-    public void onOpen(Connection connection) {
-        this.connection = connection;
-        this.connectLatch.countDown();
+    //----- Internal implementation ------------------------------------------//
+
+    private void checkConnected() throws IOException {
+        if (!isConnected()) {
+            throw new IOException("MQTT WS Connection is closed.");
+        }
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.jetty.websocket.api.WebSocketListener#onWebSocketClose(int, java.lang.String)
+     */
     @Override
-    public void onClose(int closeCode, String message) {
-        LOG.trace("MQTT WS Connection closed, code:{} message:{}", closeCode, message);
+    public void onWebSocketClose(int statusCode, String reason) {
+        LOG.trace("MQTT WS Connection closed, code:{} message:{}", statusCode, reason);
 
         this.connection = null;
-        this.closeCode = closeCode;
-        this.closeMessage = message;
-    }
+        this.closeCode = statusCode;
+        this.closeMessage = reason;
 
-    //----- Internal implementation ------------------------------------------//
+    }
 
-    private void checkConnected() throws IOException {
-        if (!isConnected()) {
-            throw new IOException("MQTT WS Connection is closed.");
-        }
+    /* (non-Javadoc)
+     * @see org.eclipse.jetty.websocket.api.WebSocketListener#onWebSocketConnect(org.eclipse.jetty.websocket.api.Session)
+     */
+    @Override
+    public void onWebSocketConnect(
+            org.eclipse.jetty.websocket.api.Session session) {
+        this.connection = session;
+        this.connectLatch.countDown();
     }
+
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java
index d587371..745fdcf 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSConnectionTimeoutTest.java
@@ -23,8 +23,8 @@ import java.util.Vector;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.util.Wait;
-import org.eclipse.jetty.websocket.WebSocketClient;
-import org.eclipse.jetty.websocket.WebSocketClientFactory;
+import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -39,15 +39,20 @@ public class MQTTWSConnectionTimeoutTest extends WSTransportTestSupport {
     @Before
     public void setUp() throws Exception {
         super.setUp();
+        wsMQTTConnection = new MQTTWSConnection();
 
-        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
-        clientFactory.start();
+       // WebSocketClientFactory clientFactory = new WebSocketClientFactory();
+        //clientFactory.start();
 
-        wsClient = clientFactory.newWebSocketClient();
-        wsClient.setProtocol("mqttv3.1");
-        wsMQTTConnection = new MQTTWSConnection();
+        wsClient = new WebSocketClient();
+        wsClient.start();
+
+        ClientUpgradeRequest request = new ClientUpgradeRequest();
+        request.setSubProtocols("mqtt");
+
+        wsClient.connect(wsMQTTConnection, wsConnectUri, request);
+        //wsClient.setProtocol("mqttv3.1");
 
-        wsClient.open(wsConnectUri, wsMQTTConnection);
         if (!wsMQTTConnection.awaitConnection(30, TimeUnit.SECONDS)) {
             throw new IOException("Could not connect to MQTT WS endpoint");
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSLinkStealingTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSLinkStealingTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSLinkStealingTest.java
index 2d94eaa..d5c918d 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSLinkStealingTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSLinkStealingTest.java
@@ -23,8 +23,8 @@ import java.io.IOException;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.util.Wait;
-import org.eclipse.jetty.websocket.WebSocketClient;
-import org.eclipse.jetty.websocket.WebSocketClientFactory;
+import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -38,21 +38,22 @@ public class MQTTWSLinkStealingTest extends WSTransportTestSupport {
 
     protected WebSocketClient wsClient;
     protected MQTTWSConnection wsMQTTConnection;
+    protected ClientUpgradeRequest request;
 
     @Override
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
-        clientFactory.start();
+        wsMQTTConnection = new MQTTWSConnection();
 
-        wsClient = clientFactory.newWebSocketClient();
-        wsClient.setProtocol("mqttv3.1");
+        wsClient = new WebSocketClient();
+        wsClient.start();
 
-        wsMQTTConnection = new MQTTWSConnection();
+        request = new ClientUpgradeRequest();
+        request.setSubProtocols("mqttv3.1");
 
-        wsClient.open(wsConnectUri, wsMQTTConnection);
+        wsClient.connect(wsMQTTConnection, wsConnectUri, request);
         if (!wsMQTTConnection.awaitConnection(30, TimeUnit.SECONDS)) {
             throw new IOException("Could not connect to MQTT WS endpoint");
         }
@@ -83,12 +84,10 @@ public class MQTTWSLinkStealingTest extends WSTransportTestSupport {
             }
         }));
 
-        WebSocketClientFactory theifFactory = new WebSocketClientFactory();
-        theifFactory.start();
 
         MQTTWSConnection theif = new MQTTWSConnection();
 
-        wsClient.open(wsConnectUri, theif);
+        wsClient.connect(theif, wsConnectUri, request);
         if (!theif.awaitConnection(30, TimeUnit.SECONDS)) {
             fail("Could not open new WS connection for link stealing client");
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSTransportTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSTransportTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSTransportTest.java
index b62442a..a74a160 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSTransportTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/MQTTWSTransportTest.java
@@ -25,8 +25,8 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.activemq.util.Wait;
-import org.eclipse.jetty.websocket.WebSocketClient;
-import org.eclipse.jetty.websocket.WebSocketClientFactory;
+import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.fusesource.hawtbuf.UTF8Buffer;
 import org.fusesource.mqtt.codec.CONNACK;
 import org.fusesource.mqtt.codec.CONNECT;
@@ -40,21 +40,22 @@ public class MQTTWSTransportTest extends WSTransportTestSupport {
 
     protected WebSocketClient wsClient;
     protected MQTTWSConnection wsMQTTConnection;
+    protected ClientUpgradeRequest request;
 
     @Override
     @Before
     public void setUp() throws Exception {
         super.setUp();
 
-        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
-        clientFactory.start();
+        wsClient = new WebSocketClient();
+        wsClient.start();
 
-        wsClient = clientFactory.newWebSocketClient();
-        wsClient.setProtocol("mqttv3.1");
+        request = new ClientUpgradeRequest();
+        request.setSubProtocols("mqttv3.1");
 
         wsMQTTConnection = new MQTTWSConnection();
 
-        wsClient.open(wsConnectUri, wsMQTTConnection);
+        wsClient.connect(wsMQTTConnection, wsConnectUri, request);
         if (!wsMQTTConnection.awaitConnection(30, TimeUnit.SECONDS)) {
             throw new IOException("Could not connect to MQTT WS endpoint");
         }
@@ -79,7 +80,7 @@ public class MQTTWSTransportTest extends WSTransportTestSupport {
 
             wsMQTTConnection = new MQTTWSConnection();
 
-            wsClient.open(wsConnectUri, wsMQTTConnection);
+            wsClient.connect(wsMQTTConnection, wsConnectUri, request);
             if (!wsMQTTConnection.awaitConnection(30, TimeUnit.SECONDS)) {
                 throw new IOException("Could not connect to MQTT WS endpoint");
             }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/SocketTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/SocketTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/SocketTest.java
index c44d672..8f65384 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/SocketTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/SocketTest.java
@@ -18,6 +18,8 @@ package org.apache.activemq.transport.ws;
 
 import static org.junit.Assert.assertEquals;
 
+import org.apache.activemq.transport.ws.jetty9.MQTTSocket;
+import org.apache.activemq.transport.ws.jetty9.StompSocket;
 import org.junit.Test;
 
 public class SocketTest {
@@ -25,8 +27,7 @@ public class SocketTest {
     @Test
     public void testStompSocketRemoteAddress() {
 
-        org.apache.activemq.transport.ws.jetty8.StompSocket stompSocketJetty8 =
-                new org.apache.activemq.transport.ws.jetty8.StompSocket("ws://localhost:8080");
+        StompSocket stompSocketJetty8 = new StompSocket("ws://localhost:8080");
 
         assertEquals("ws://localhost:8080", stompSocketJetty8.getRemoteAddress());
 
@@ -39,13 +40,11 @@ public class SocketTest {
     @Test
     public void testMqttSocketRemoteAddress() {
 
-        org.apache.activemq.transport.ws.jetty8.MQTTSocket mqttSocketJetty8 =
-                new org.apache.activemq.transport.ws.jetty8.MQTTSocket("ws://localhost:8080");
+        MQTTSocket mqttSocketJetty8 = new MQTTSocket("ws://localhost:8080");
 
         assertEquals("ws://localhost:8080", mqttSocketJetty8.getRemoteAddress());
 
-        org.apache.activemq.transport.ws.jetty8.MQTTSocket mqttSocketJetty9 =
-                new org.apache.activemq.transport.ws.jetty8.MQTTSocket("ws://localhost:8080");
+        MQTTSocket mqttSocketJetty9 = new MQTTSocket("ws://localhost:8080");
 
         assertEquals("ws://localhost:8080", mqttSocketJetty9.getRemoteAddress());
     }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnection.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnection.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnection.java
index 09ec106..8531c73 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnection.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnection.java
@@ -23,18 +23,20 @@ import java.util.concurrent.LinkedBlockingDeque;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.transport.stomp.StompFrame;
-import org.eclipse.jetty.websocket.WebSocket;
+import org.eclipse.jetty.websocket.api.Session;
+import org.eclipse.jetty.websocket.api.WebSocketAdapter;
+import org.eclipse.jetty.websocket.api.WebSocketListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
  * STOMP over WS based Connection class
  */
-public class StompWSConnection implements WebSocket, WebSocket.OnTextMessage {
+public class StompWSConnection extends WebSocketAdapter implements WebSocketListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(StompWSConnection.class);
 
-    private Connection connection;
+    private Session connection;
     private final CountDownLatch connectLatch = new CountDownLatch(1);
 
     private final BlockingQueue<String> prefetch = new LinkedBlockingDeque<String>();
@@ -42,6 +44,7 @@ public class StompWSConnection implements WebSocket, WebSocket.OnTextMessage {
     private int closeCode = -1;
     private String closeMessage;
 
+    @Override
     public boolean isConnected() {
         return connection != null ? connection.isOpen() : false;
     }
@@ -56,17 +59,17 @@ public class StompWSConnection implements WebSocket, WebSocket.OnTextMessage {
 
     public void sendRawFrame(String rawFrame) throws Exception {
         checkConnected();
-        connection.sendMessage(rawFrame);
+        connection.getRemote().sendString(rawFrame);
     }
 
     public void sendFrame(StompFrame frame) throws Exception {
         checkConnected();
-        connection.sendMessage(frame.format());
+        connection.getRemote().sendString(frame.format());
     }
 
     public void keepAlive() throws Exception {
         checkConnected();
-        connection.sendMessage("\n");
+        connection.getRemote().sendString("\n");
     }
 
     //----- Receive methods --------------------------------------------------//
@@ -109,7 +112,7 @@ public class StompWSConnection implements WebSocket, WebSocket.OnTextMessage {
     //----- WebSocket callback handlers --------------------------------------//
 
     @Override
-    public void onMessage(String data) {
+    public void onWebSocketText(String data) {
         if (data == null) {
             return;
         }
@@ -122,19 +125,28 @@ public class StompWSConnection implements WebSocket, WebSocket.OnTextMessage {
         }
     }
 
-    @Override
-    public void onOpen(Connection connection) {
-        this.connection = connection;
-        this.connectLatch.countDown();
-    }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.jetty.websocket.api.WebSocketListener#onWebSocketClose(int, java.lang.String)
+     */
     @Override
-    public void onClose(int closeCode, String message) {
-        LOG.trace("STOMP WS Connection closed, code:{} message:{}", closeCode, message);
+    public void onWebSocketClose(int statusCode, String reason) {
+        LOG.trace("STOMP WS Connection closed, code:{} message:{}", statusCode, reason);
 
         this.connection = null;
-        this.closeCode = closeCode;
-        this.closeMessage = message;
+        this.closeCode = statusCode;
+        this.closeMessage = reason;
+
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jetty.websocket.api.WebSocketListener#onWebSocketConnect(org.eclipse.jetty.websocket.api.Session)
+     */
+    @Override
+    public void onWebSocketConnect(
+            org.eclipse.jetty.websocket.api.Session session) {
+        this.connection = session;
+        this.connectLatch.countDown();
     }
 
     //----- Internal implementation ------------------------------------------//

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java
index b0ca372..83cbd69 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSConnectionTimeoutTest.java
@@ -23,8 +23,7 @@ import java.util.Vector;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.util.Wait;
-import org.eclipse.jetty.websocket.WebSocketClient;
-import org.eclipse.jetty.websocket.WebSocketClientFactory;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -42,14 +41,16 @@ public class StompWSConnectionTimeoutTest extends WSTransportTestSupport {
     @Before
     public void setUp() throws Exception {
         super.setUp();
+        wsStompConnection = new StompWSConnection();
+
+//        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
+//        clientFactory.start();
+        wsClient = new WebSocketClient();
+        wsClient.start();
 
-        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
-        clientFactory.start();
 
-        wsClient = clientFactory.newWebSocketClient();
-        wsStompConnection = new StompWSConnection();
 
-        wsClient.open(wsConnectUri, wsStompConnection);
+        wsClient.connect(wsStompConnection, wsConnectUri);
         if (!wsStompConnection.awaitConnection(30, TimeUnit.SECONDS)) {
             throw new IOException("Could not connect to STOMP WS endpoint");
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java
index c6bfdd4..45bfa7f 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java
@@ -27,8 +27,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.activemq.transport.stomp.Stomp;
 import org.apache.activemq.transport.stomp.StompFrame;
 import org.apache.activemq.util.Wait;
-import org.eclipse.jetty.websocket.WebSocketClient;
-import org.eclipse.jetty.websocket.WebSocketClientFactory;
+import org.eclipse.jetty.websocket.client.WebSocketClient;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -49,14 +48,12 @@ public class StompWSTransportTest extends WSTransportTestSupport {
     @Before
     public void setUp() throws Exception {
         super.setUp();
-
-        WebSocketClientFactory clientFactory = new WebSocketClientFactory();
-        clientFactory.start();
-
-        wsClient = clientFactory.newWebSocketClient();
         wsStompConnection = new StompWSConnection();
 
-        wsClient.open(wsConnectUri, wsStompConnection);
+        wsClient = new WebSocketClient();
+        wsClient.start();
+
+        wsClient.connect(wsStompConnection, wsConnectUri);
         if (!wsStompConnection.awaitConnection(30, TimeUnit.SECONDS)) {
             throw new IOException("Could not connect to STOMP WS endpoint");
         }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
index 546209e..f9fe74d 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTest.java
@@ -74,9 +74,6 @@ public class WSTransportTest extends WSTransportTestSupport {
         Server server = new Server();
 
         Connector connector = createJettyConnector(server);
-        if (Server.getVersion().startsWith("8")) {
-            connector.setServer(server);
-        }
 
         WebAppContext context = new WebAppContext();
         context.setResourceBase("src/test/webapp");

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTestSupport.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTestSupport.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTestSupport.java
index c745221..edf7b6c 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTestSupport.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/WSTransportTestSupport.java
@@ -69,11 +69,18 @@ public class WSTransportTestSupport {
         LOG.info("========== Finished test: {} ==========", name.getMethodName());
     }
 
+//    protected String getWSConnectorURI() {
+//        return "ws://127.0.0.1:" + getProxyPort() +
+//            "?allowLinkStealing=" + isAllowLinkStealing() +
+//            "&websocket.maxTextMessageSize=99999&" +
+//            "transport.maxIdleTime=1001";
+//    }
+
     protected String getWSConnectorURI() {
         return "ws://127.0.0.1:" + getProxyPort() +
             "?allowLinkStealing=" + isAllowLinkStealing() +
             "&websocket.maxTextMessageSize=99999&" +
-            "transport.maxIdleTime=1001";
+            "transport.idleTimeout=1001";
     }
 
     protected boolean isAllowLinkStealing() {

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/test/java/org/apache/activemq/transport/wss/WSSTransportTest.java
----------------------------------------------------------------------
diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/wss/WSSTransportTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/wss/WSSTransportTest.java
index 36b33f6..6af0f4e 100644
--- a/activemq-http/src/test/java/org/apache/activemq/transport/wss/WSSTransportTest.java
+++ b/activemq-http/src/test/java/org/apache/activemq/transport/wss/WSSTransportTest.java
@@ -20,6 +20,7 @@ import org.apache.activemq.transport.SecureSocketConnectorFactory;
 import org.apache.activemq.transport.ws.WSTransportTest;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 
 public class WSSTransportTest extends WSTransportTest {
     @Override
@@ -29,9 +30,9 @@ public class WSSTransportTest extends WSTransportTest {
         sscf.setKeyStorePassword("password");
         sscf.setTrustStore("src/test/resources/client.keystore");
         sscf.setTrustStorePassword("password");
-        
-        Connector c = sscf.createConnector(server);
-        c.getClass().getMethod("setPort", Integer.TYPE).invoke(c, getProxyPort());
+
+        ServerConnector c = (ServerConnector) sscf.createConnector(server);
+        c.setPort(getProxyPort());
         return c;
     }
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-http/src/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/activemq-http/src/webapp/WEB-INF/web.xml b/activemq-http/src/webapp/WEB-INF/web.xml
index 2ae5ca6..779410e 100755
--- a/activemq-http/src/webapp/WEB-INF/web.xml
+++ b/activemq-http/src/webapp/WEB-INF/web.xml
@@ -16,11 +16,10 @@
     limitations under the License.
 -->
 
-<!DOCTYPE web-app
-    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-    "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+      version="3.0"> 
 
     <display-name>ActiveMQ Message Broker Web Application</display-name>
     <description>
@@ -29,9 +28,9 @@
 
     <!-- context config -->
     <context-param>
+    	<description>The URL that the embedded broker should listen on in addition to HTTP</description>
         <param-name>org.apache.activemq.brokerURL</param-name>
-        <param-value>tcp://localhost:61616</param-value>
-        <description>The URL that the embedded broker should listen on in addition to HTTP</description>
+        <param-value>tcp://localhost:61616</param-value>     
     </context-param>
 
 

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-osgi/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-osgi/pom.xml b/activemq-osgi/pom.xml
index 92cd330..a583717 100644
--- a/activemq-osgi/pom.xml
+++ b/activemq-osgi/pom.xml
@@ -52,7 +52,7 @@
       com.fasterxml.jackson*;resolution:=optional,
       org.codehaus.jettison*;resolution:=optional,
       org.jasypt*;resolution:=optional,
-      org.eclipse.jetty*;resolution:=optional;version="[8.1,10)",
+      org.eclipse.jetty*;resolution:=optional;version="[9.0,10)",
       org.apache.zookeeper*;resolution:=optional,
       org.fusesource.leveldbjni*;resolution:=optional,
       org.fusesource.hawtjni*;resolution:=optional,

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-console/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-web-console/pom.xml b/activemq-web-console/pom.xml
index 1dd2250..fde16e4 100755
--- a/activemq-web-console/pom.xml
+++ b/activemq-web-console/pom.xml
@@ -32,7 +32,7 @@
 
   <properties>
     <jetty.port>8080</jetty.port>
-    <jetty.maven.groupid>org.mortbay.jetty</jetty.maven.groupid>
+    <jetty.maven.groupid>org.eclipse.jetty</jetty.maven.groupid>
   </properties>
 
   <build>
@@ -57,7 +57,7 @@
         <version>${jetty-version}</version>
         <configuration>
           <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <connector implementation="org.eclipse.jetty.server.ServerConnector">
               <port>${jetty.port}</port>
               <maxIdleTime>60000</maxIdleTime>
             </connector>
@@ -158,7 +158,7 @@
               org.slf4j.spi;version="[1.6,2)";resolution:=optional,
               org.apache.log4j;version="[1.2.14,2)";resolution:=optional,
               org.apache.log4j.spi;version="[1.2.14,2)";resolution:=optional,
-              org.eclipse.jetty*;resolution:=optional;version="[8.1,10)"
+              org.eclipse.jetty*;resolution:=optional;version="[9.0,10)"
             </Import-Package>
           </instructions>
         </configuration>
@@ -167,18 +167,17 @@
   </build>
 
   <dependencies>
-
     <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-servlet_3.0_spec</artifactId>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-servlet-api</artifactId>
       <scope>provided</scope>
     </dependency>
     <dependency>
-        <groupId>org.apache.geronimo.specs</groupId>
-        <artifactId>geronimo-jsp_2.1_spec</artifactId>
-        <scope>provided</scope>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>tomcat-websocket-api</artifactId>
+      <scope>provided</scope>
     </dependency>
-
+      
     <!-- j2ee jars -->
     <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
@@ -207,8 +206,8 @@
               <artifactId>activemq-all</artifactId>
           </exclusion>
           <exclusion>
-              <groupId>org.eclipse.jetty</groupId>
-              <artifactId>jetty-websocket</artifactId>
+              <groupId>org.eclipse.jetty.websocket</groupId>
+              <artifactId>websocket-server</artifactId>
           </exclusion>
           <exclusion>
               <groupId>org.eclipse.jetty</groupId>
@@ -247,10 +246,10 @@
       <artifactId>jetty-all</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.eclipse.jdt</groupId>
-      <artifactId>core</artifactId>
-      <version>3.1.1</version>
+     <dependency>
+      <groupId>org.eclipse.jetty.orbit</groupId>
+      <artifactId>org.eclipse.jdt.core</artifactId>
+      <version>3.8.2.v20130121</version>
       <scope>test</scope>
     </dependency>
     <dependency>
@@ -267,15 +266,13 @@
     </dependency>
 
     <!-- JSTL support -->
+    
     <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>jstl</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>taglibs</groupId>
-      <artifactId>standard</artifactId>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>apache-jstl</artifactId>
+      <scope>provided</scope>
     </dependency>
-
+    
     <!-- used for testing -->
     <dependency>
       <groupId>junit</groupId>
@@ -284,6 +281,41 @@
     </dependency>
 
     <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>activemq-unit-tests</artifactId>
+      <scope>test</scope>
+      <type>test-jar</type>
+    </dependency>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>activemq-broker</artifactId>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>apache-jsp</artifactId>
+      <scope>provided</scope>
+      <exclusions>
+          <exclusion>
+              <groupId>javax.servlet</groupId>
+              <artifactId>javax.servlet-api</artifactId>
+          </exclusion>
+      </exclusions>
+    </dependency>
+    
+     <dependency>
+       <groupId>org.apache.geronimo.specs</groupId>
+       <artifactId>geronimo-annotation_1.0_spec</artifactId>
+    </dependency>
+ 
+
+	<dependency>
+		<groupId>org.ow2.asm</groupId>
+		<artifactId>asm</artifactId>
+	</dependency>
+    <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
       <scope>provided</scope>

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml
----------------------------------------------------------------------
diff --git a/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml b/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml
index 7203bef..c7ed77f 100755
--- a/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml
+++ b/activemq-web-console/src/main/webapp/WEB-INF/activemq.xml
@@ -30,7 +30,7 @@
   <broker brokerName="web-console" useJmx="true" xmlns="http://activemq.apache.org/schema/core">
 
     <persistenceAdapter>
-      <kahaDB directory="${activemq.data}/kahadb"/>
+      <kahaDB directory="target/kahadb"/>
     </persistenceAdapter>
 
     <transportConnectors>

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-console/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/activemq-web-console/src/main/webapp/WEB-INF/web.xml b/activemq-web-console/src/main/webapp/WEB-INF/web.xml
index d647002..962713e 100755
--- a/activemq-web-console/src/main/webapp/WEB-INF/web.xml
+++ b/activemq-web-console/src/main/webapp/WEB-INF/web.xml
@@ -16,11 +16,10 @@
     limitations under the License.
 -->
 
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-         version="2.4">
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+      version="3.0"> 
 
   <description>
     Apache ActiveMQ Web Console

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
----------------------------------------------------------------------
diff --git a/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java b/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
index ab9d482..2c8fb48 100644
--- a/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
+++ b/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
@@ -17,15 +17,16 @@
 
 package org.apache.activemq.web.tool;
 
-import org.eclipse.jetty.server.Connector;
+import org.apache.activemq.web.config.JspConfigurer;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.ContextHandlerCollection;
 import org.eclipse.jetty.webapp.WebAppContext;
 
 /**
  * A simple bootstrap class for starting Jetty in your IDE using the local web
  * application.
- * 
- * 
+ *
+ *
  */
 public final class Main {
 
@@ -45,6 +46,8 @@ public final class Main {
             String text = args[0];
             port = Integer.parseInt(text);
         }
+
+        System.setProperty("activemq.conf", "/home/clshann/dev/git/apache-activemq/assembly/target/apache-activemq-5.13-SNAPSHOT/conf");
         System.out.println("Starting Web Server on port: " + port);
         System.setProperty("jetty.port", "" + port);
         Server server = new Server(port);
@@ -54,11 +57,16 @@ public final class Main {
         //System.setProperty("webconsole.jmx.url","service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root");
 
         WebAppContext context = new WebAppContext();
+        ContextHandlerCollection handlers = new ContextHandlerCollection();
+        handlers.setHandlers(new WebAppContext[] {context});
+
+        JspConfigurer.configureJetty(server, handlers);
+
 
         context.setResourceBase(WEBAPP_DIR);
         context.setContextPath(WEBAPP_CTX);
         context.setServer(server);
-        server.setHandler(context);
+        server.setHandler(handlers);
         server.start();
 
         System.out.println();
@@ -67,4 +75,6 @@ public final class Main {
         System.out.println("==============================================================================");
         System.out.println();
     }
+
+
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-demo/pom.xml
----------------------------------------------------------------------
diff --git a/activemq-web-demo/pom.xml b/activemq-web-demo/pom.xml
index 58aa3b1..29562b0 100755
--- a/activemq-web-demo/pom.xml
+++ b/activemq-web-demo/pom.xml
@@ -33,12 +33,11 @@
   <build>
     <plugins>
       <plugin>
-        <groupId>org.mortbay.jetty</groupId>
+        <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-maven-plugin</artifactId>
-        <version>${jetty-version}</version>
         <configuration>
           <connectors>
-            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
+            <connector implementation="org.eclipse.jetty.server.ServerConnector">
               <port>${jetty.port}</port>
               <maxIdleTime>60000</maxIdleTime>
             </connector>

http://git-wip-us.apache.org/repos/asf/activemq/blob/f44c3d20/activemq-web-demo/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/activemq-web-demo/src/main/webapp/WEB-INF/web.xml b/activemq-web-demo/src/main/webapp/WEB-INF/web.xml
index 742604a..cd39366 100755
--- a/activemq-web-demo/src/main/webapp/WEB-INF/web.xml
+++ b/activemq-web-demo/src/main/webapp/WEB-INF/web.xml
@@ -15,25 +15,25 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<!DOCTYPE web-app
-    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-    "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+      version="3.0"> 
 
     <display-name>Apache ActiveMQ Web Demo</display-name>
 
     <!-- context config -->
     <context-param>
+    	<description>Whether we should include an embedded broker or not</description>
         <param-name>org.apache.activemq.embeddedBroker</param-name>
-        <param-value>true</param-value>
-        <description>Whether we should include an embedded broker or not</description>
+        <param-value>true</param-value>       
     </context-param>
 
 	<!-- filters -->
 	<filter>
 		<filter-name>session</filter-name>
 		<filter-class>org.apache.activemq.web.SessionFilter</filter-class>
+		<async-supported>true</async-supported>
 	</filter>
 	<filter-mapping>
 		<filter-name>session</filter-name>
@@ -52,12 +52,14 @@
         <servlet-name>AjaxServlet</servlet-name>
         <servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
+        <async-supported>true</async-supported>
     </servlet>
 
     <servlet>
         <servlet-name>MessageServlet</servlet-name>
         <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
+        <async-supported>true</async-supported>
         <!--
         Uncomment this parameter if you plan to use multiple consumers over REST
         <init-param>
@@ -71,6 +73,7 @@
     <servlet>
         <servlet-name>QueueBrowseServlet</servlet-name>
         <servlet-class>org.apache.activemq.web.QueueBrowseServlet</servlet-class>
+        <async-supported>true</async-supported>
     </servlet>
 
     <!-- servlets for the portfolio demo -->
@@ -78,6 +81,7 @@
         <servlet-name>PortfolioPublishServlet</servlet-name>
         <servlet-class>org.apache.activemq.web.PortfolioPublishServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
+        <async-supported>true</async-supported>
     </servlet>
 
 	<!-- servlet mappings -->


Mime
View raw message