Repository: cxf Updated Branches: refs/heads/master b3ec59efc -> 66447a377
upgrade atmosphere to 2.4.3 Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/66447a37 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/66447a37 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/66447a37 Branch: refs/heads/master Commit: 66447a377f0b2cafc2f337456b5fd41f832556e0 Parents: b3ec59e Author: Akitoshi Yoshida <a...@apache.org> Authored: Thu Mar 24 19:33:49 2016 +0100 Committer: Akitoshi Yoshida <a...@apache.org> Committed: Thu Mar 24 19:33:49 2016 +0100 ---------------------------------------------------------------------- parent/pom.xml | 4 ++-- .../atmosphere/AtmosphereWebSocketJettyDestination.java | 10 ++++++---- .../atmosphere/AtmosphereWebSocketServletDestination.java | 10 ++++++---- .../websocket/atmosphere/DefaultProtocolInterceptor.java | 6 ++++-- .../atmosphere/DefaultProtocolInterceptorTest.java | 6 ++++-- 5 files changed, 22 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/66447a37/parent/pom.xml ---------------------------------------------------------------------- diff --git a/parent/pom.xml b/parent/pom.xml index 864df71..28c21cc 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -69,8 +69,8 @@ <cxf.activemq.version>5.12.1</cxf.activemq.version> <cxf.ahc.version>1.9.8</cxf.ahc.version> <cxf.apacheds.version>2.0.0-M21</cxf.apacheds.version> - <cxf.atmosphere.version>2.3.5</cxf.atmosphere.version> - <cxf.atmosphere.version.range>[2.0,3.0)</cxf.atmosphere.version.range> + <cxf.atmosphere.version>2.4.3</cxf.atmosphere.version> + <cxf.atmosphere.version.range>[2.4,3.0)</cxf.atmosphere.version.range> <cxf.axiom.version>1.2.14</cxf.axiom.version> <cxf.bcprov.version>1.54</cxf.bcprov.version> <cxf.cglib.bundle.version>2.2_2</cxf.cglib.bundle.version> http://git-wip-us.apache.org/repos/asf/cxf/blob/66447a37/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketJettyDestination.java ---------------------------------------------------------------------- diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketJettyDestination.java b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketJettyDestination.java index d0cc806..8a8ba84 100644 --- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketJettyDestination.java +++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketJettyDestination.java @@ -41,9 +41,9 @@ import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory; import org.apache.cxf.transport.websocket.WebSocketDestinationService; import org.atmosphere.cpr.ApplicationConfig; import org.atmosphere.cpr.AtmosphereFramework; -import org.atmosphere.cpr.AtmosphereRequest; +import org.atmosphere.cpr.AtmosphereRequestImpl; import org.atmosphere.cpr.AtmosphereResource; -import org.atmosphere.cpr.AtmosphereResponse; +import org.atmosphere.cpr.AtmosphereResponseImpl; import org.atmosphere.handler.AbstractReflectorAtmosphereHandler; import org.eclipse.jetty.server.Request; @@ -65,6 +65,8 @@ public class AtmosphereWebSocketJettyDestination extends JettyHTTPDestination im framework.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); + // workaround for atmosphere's jsr356 initialization requiring servletConfig + framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true"); AtmosphereUtils.addInterceptors(framework, bus); framework.addAtmosphereHandler("/", new DestinationHandler()); framework.init(); @@ -120,8 +122,8 @@ public class AtmosphereWebSocketJettyDestination extends JettyHTTPDestination im HttpServletResponse response) throws IOException, ServletException { if (AtmosphereUtils.useAtmosphere(request)) { try { - framework.doCometSupport(AtmosphereRequest.wrap(request), - AtmosphereResponse.wrap(response)); + framework.doCometSupport(AtmosphereRequestImpl.wrap(request), + AtmosphereResponseImpl.wrap(response)); baseRequest.setHandled(true); } catch (ServletException e) { throw new IOException(e); http://git-wip-us.apache.org/repos/asf/cxf/blob/66447a37/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketServletDestination.java ---------------------------------------------------------------------- diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketServletDestination.java b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketServletDestination.java index a4e702c..6df7149 100644 --- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketServletDestination.java +++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/AtmosphereWebSocketServletDestination.java @@ -37,9 +37,9 @@ import org.apache.cxf.transport.servlet.ServletDestination; import org.apache.cxf.transport.websocket.WebSocketDestinationService; import org.atmosphere.cpr.ApplicationConfig; import org.atmosphere.cpr.AtmosphereFramework; -import org.atmosphere.cpr.AtmosphereRequest; +import org.atmosphere.cpr.AtmosphereRequestImpl; import org.atmosphere.cpr.AtmosphereResource; -import org.atmosphere.cpr.AtmosphereResponse; +import org.atmosphere.cpr.AtmosphereResponseImpl; import org.atmosphere.handler.AbstractReflectorAtmosphereHandler; /** @@ -60,6 +60,8 @@ public class AtmosphereWebSocketServletDestination extends ServletDestination im framework.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); + // workaround for atmosphere's jsr356 initialization requiring servletConfig + framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true"); AtmosphereUtils.addInterceptors(framework, bus); framework.addAtmosphereHandler("/", new DestinationHandler()); framework.init(); @@ -70,8 +72,8 @@ public class AtmosphereWebSocketServletDestination extends ServletDestination im HttpServletResponse resp) throws IOException { if (AtmosphereUtils.useAtmosphere(req)) { try { - framework.doCometSupport(AtmosphereRequest.wrap(req), - AtmosphereResponse.wrap(resp)); + framework.doCometSupport(AtmosphereRequestImpl.wrap(req), + AtmosphereResponseImpl.wrap(resp)); } catch (ServletException e) { throw new IOException(e); } http://git-wip-us.apache.org/repos/asf/cxf/blob/66447a37/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java ---------------------------------------------------------------------- diff --git a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java index 2631d51..b687d57 100644 --- a/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java +++ b/rt/transports/websocket/src/main/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptor.java @@ -47,10 +47,12 @@ import org.atmosphere.cpr.AtmosphereFramework; import org.atmosphere.cpr.AtmosphereInterceptorAdapter; import org.atmosphere.cpr.AtmosphereInterceptorWriter; import org.atmosphere.cpr.AtmosphereRequest; +import org.atmosphere.cpr.AtmosphereRequestImpl; import org.atmosphere.cpr.AtmosphereResource; import org.atmosphere.cpr.AtmosphereResourceEvent; import org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter; import org.atmosphere.cpr.AtmosphereResponse; +import org.atmosphere.cpr.AtmosphereResponseImpl; import org.atmosphere.cpr.FrameworkConfig; /** @@ -262,7 +264,7 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter { * @throws IOException */ protected AtmosphereRequest createAtmosphereRequest(AtmosphereRequest r, byte[] data) throws IOException { - AtmosphereRequest.Builder b = new AtmosphereRequest.Builder(); + AtmosphereRequest.Builder b = new AtmosphereRequestImpl.Builder(); ByteArrayInputStream in = new ByteArrayInputStream(data); Map<String, String> hdrs = WebSocketUtils.readHeaders(in); String path = hdrs.get(WebSocketUtils.URI_KEY); @@ -362,7 +364,7 @@ public class DefaultProtocolInterceptor extends AtmosphereInterceptorAdapter { } // a workaround to flush the header data upon close when no write operation occurs - private class WrappedAtmosphereResponse extends AtmosphereResponse { + private class WrappedAtmosphereResponse extends AtmosphereResponseImpl { final AtmosphereResponse response; ServletOutputStream sout; WrappedAtmosphereResponse(AtmosphereResponse resp, AtmosphereRequest req) throws IOException { http://git-wip-us.apache.org/repos/asf/cxf/blob/66447a37/rt/transports/websocket/src/test/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptorTest.java ---------------------------------------------------------------------- diff --git a/rt/transports/websocket/src/test/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptorTest.java b/rt/transports/websocket/src/test/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptorTest.java index 1dee1de..7a5d5b9 100644 --- a/rt/transports/websocket/src/test/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptorTest.java +++ b/rt/transports/websocket/src/test/java/org/apache/cxf/transport/websocket/atmosphere/DefaultProtocolInterceptorTest.java @@ -25,9 +25,11 @@ import java.util.Map; import org.apache.cxf.transport.websocket.WebSocketUtils; import org.atmosphere.cpr.AtmosphereRequest; +import org.atmosphere.cpr.AtmosphereRequestImpl; import org.atmosphere.cpr.AtmosphereResource; import org.atmosphere.cpr.AtmosphereResourceImpl; import org.atmosphere.cpr.AtmosphereResponse; +import org.atmosphere.cpr.AtmosphereResponseImpl; import org.atmosphere.cpr.FrameworkConfig; import org.junit.Assert; @@ -41,8 +43,8 @@ public class DefaultProtocolInterceptorTest extends Assert { @Test public void testCreateResponseWithHeadersFiltering() throws Exception { DefaultProtocolInterceptor dpi = new DefaultProtocolInterceptor(); - AtmosphereRequest request = AtmosphereRequest.newInstance(); - AtmosphereResponse response = AtmosphereResponse.newInstance(); + AtmosphereRequest request = AtmosphereRequestImpl.newInstance(); + AtmosphereResponse response = AtmosphereResponseImpl.newInstance(); AtmosphereResourceImpl resource = new AtmosphereResourceImpl(); resource.transport(AtmosphereResource.TRANSPORT.WEBSOCKET); request.localAttributes().put(FrameworkConfig.ATMOSPHERE_RESOURCE, resource);