[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #10 from rstoyanc...@yahoo.com --- I've tried this and it works as expected. Thanks! -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #11 from Mark Thomas ma...@apache.org --- Excellent. Thanks for the feedback. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #9 from Mark Thomas ma...@apache.org --- I've implemented the method in comment #7 Feel free to re-open if this doesn't meet the requirement. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #8 from Mark Thomas ma...@apache.org --- Thinking about this some more, wouldn't it be easier from a developer point of view just to forward the request and let WsFilter do all the work? -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #7 from Mark Thomas ma...@apache.org --- I've done some refactoring locally. Would the following method on WsServerContainer meet you requirements? public void doUpgrade( HttpServletRequest request, HttpServletResponse response, ServerEndpointConfig sec, MapString,String pathParams) throws ServletException, IOException -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED |--- --- Comment #6 from Mark Thomas ma...@apache.org --- Re-open to see what can be done with respect to on demand upgrade. As a (not very pretty) workaround, it should be possible to replicate the code in the WsFilter that triggers the upgrade. The sort of fix I have in mind is to extract the bulk of this out into a helper class (possibly a new class, possibly an existing one) that can then be used by other Servlets / Filters as well. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #5 from rstoyanc...@yahoo.com --- Mark, many thanks for the change although it looks like we had different ideas about the end result. From what I can see the solution makes it possible to call ServerContainer.addEndpoint at runtime after which WsFilter handles matching WebSocket handshake request. What I had in mind is the ability to create a Servlet that can do centralized HTTP request processing including WebSocket handshake requests, i.e. instead of WsFilter. It's what I meant with the comparison to the Tomcat 7 WebSocketServlet. The obvious issue is that JSR-356 doesn't provide this, at least not yet. The client-side connectToServer is similar in spirit but nothing like it on the server side. I imagined it would be something like: WsHandshakeRequest wsRequest = ... WsHandshakeResponse wsResponse = ... WsServerContainer wsContainer = ... wsContainer.upgrade(wsRequest, wsResponse, endpoint); So any intermediate solution would have to be Tomcat specific. Just a thought here on maybe providing a separate interface marked clearly as an intermidiate solution that will remain stable until the spec has an alternative and that will be deprecated afterwards, something like: NonCompliantWsServerContainer container = ... container.upgrade(wsRequest, wsResponse, endpoint); -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #3 from Mark Thomas ma...@apache.org --- (In reply to Dave Syer from comment #2) Maybe this is relevant. When I try to add the WsListener to an embedded Tomcat I get this: That looks to be a different issue. There are examples of how to do this without hitting the restriction imposed by Servlet 3.0 / Section 4.4 in the Tomcat unit tests. Essentially, you need to do this: ctx.addApplicationListener(new ApplicationListener(WsListener.class.getName(), false)); The restriction on programmtic deployment is enforced in WsServerContainer.addEndpoint(ServerEndpointConfig) -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 Mark Thomas ma...@apache.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #4 from Mark Thomas ma...@apache.org --- An option to do this has been added and it has been enabled by default. Should you wish to change this you can either set the org.apache.tomcat.websocket.STRICT_SPEC_COMPLIANCE system property to true that will change the default vaue of this option to not allow additions or you can set the org.apache.tomcat.websocket.noAddAfterHandshake servlet context attribute which explicitly sets the option for a single context. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #2 from Dave Syer david_s...@hotmail.com --- Maybe this is relevant. When I try to add the WsListener to an embedded Tomcat I get this: 2013-07-27 12:01:16.974 ERROR 31782 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Exception sending context initialized event to listener instance of class org.apache.tomcat.websocket.server.WsListener java.lang.UnsupportedOperationException: Section 4.4 of the Servlet 3.0 specification does not permit this method to be called from a ServletContextListener that was not defined in web.xml, a web-fragment.xml file nor annotated with @WebListener at org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.addFilter(StandardContext.java:6805) at org.apache.tomcat.websocket.server.WsServerContainer.setServletContext(WsServerContainer.java:132) at org.apache.tomcat.websocket.server.WsSci.init(WsSci.java:131) at org.apache.tomcat.websocket.server.WsListener.contextInitialized(WsListener.java:33) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4838) -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55314] Provide option to allow programmatic deployment of server (WebSocket) endpoint at runtime
https://issues.apache.org/bugzilla/show_bug.cgi?id=55314 --- Comment #1 from rstoyanc...@yahoo.com --- I've created a spec request also: https://java.net/jira/browse/WEBSOCKET_SPEC-211 -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org