cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/2] cxf git commit: Need to get field initialized on Jetty 9.3
Date Wed, 11 Nov 2015 15:55:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/master aad8b398e -> 2feaf1960


Need to get  field initialized on Jetty 9.3


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

Branch: refs/heads/master
Commit: efed91565ca6ded98576c4b1370c599f56d55d48
Parents: aad8b39
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed Nov 11 10:48:25 2015 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Nov 11 10:48:25 2015 -0500

----------------------------------------------------------------------
 .../websocket/jetty9/Jetty9WebSocketDestination.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/efed9156/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty9/Jetty9WebSocketDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty9/Jetty9WebSocketDestination.java
b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty9/Jetty9WebSocketDestination.java
index 3f51712..bb94430 100644
--- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty9/Jetty9WebSocketDestination.java
+++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/jetty9/Jetty9WebSocketDestination.java
@@ -22,6 +22,7 @@ package org.apache.cxf.transport.websocket.jetty9;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
+import java.lang.reflect.Field;
 import java.nio.ByteBuffer;
 import java.security.Principal;
 import java.util.Enumeration;
@@ -82,10 +83,19 @@ public class Jetty9WebSocketDestination extends JettyHTTPDestination implements
             webSocketFactory = (WebSocketServletFactory)ClassLoaderUtils
                 .loadClass("org.eclipse.jetty.websocket.server.WebSocketServerFactory",
                            WebSocketServletFactory.class).newInstance();
+            
         } catch (InstantiationException | IllegalAccessException | ClassNotFoundException
e) {
             throw new RuntimeException(e);
         }
         webSocketFactory.setCreator(new Creator());
+        
+        try {
+            Field f = webSocketFactory.getClass().getDeclaredField("objectFactory");
+            f.setAccessible(true);
+            f.set(webSocketFactory, f.getType().newInstance());
+        } catch (Throwable t) {
+            //ignore, on Jetty <=9.2 this field doesn't exist
+        }
         executor = bus.getExtension(WorkQueueManager.class).getAutomaticWorkQueue();
     }
     


Mime
View raw message