* Issue #3872 Javax Websocket Packaging
Moved JaxaxWebSocketConfiguration and SCI to config package.
Limited classpath exposure in JavaxConfiguration (more needed)
Updated tests with work around for those that needs more classes exposed
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 Javax Websocket Packaging
Moved all remaining classes from org.eclipse.jetty.websocket.javax.server
to org.eclipse.jetty.websocket.javax.server.internal.
This works when running on the classpath, but the tests fail when running
on the modulepath (eg in commandline mvn run). The issue appears to be
that the tests don't load test classes from WEB-INF/lib or WEB-INF/classes.
Instead the test classes were themselves in org.eclipse.jetty.websocket.javax.server,
which is no longer exported from module-info.java.
The hacked "fix" for this has been to create a org.eclipse.jetty.websocket.javax.server.tests
package which is exported and to move all the tests to that. A better fix is needed.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 Javax Websocket Packaging
improve comments
tighten exposed classes more
Signed-off-by: Greg Wilkins <gregw@webtide.com>
* Issue #3872 - fixing tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3872 - move ContainerDefaultConfigurator to config package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3873 - fix javax websocket test classloader issues
move websocket endpoints for test webapps to com.acme.websocket package
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3762 - use the default port of 0 for WebSocket tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3762 - use system property to set custom port in xml
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3705 - notify WebSocket framehandler on client upgrade failure
getFrameHandler on the ClientUpgradeRequest no longer takes
the upgrade response, the response must be set later if it is
required by the framehandler implementation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3705 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3705 - throw if FrameHandler could not be created
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* wip
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3705 - count down the onOpen latch in NetworkFuzzer
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
* Issue #3705 - WebSocket Session CompletableFuture refactor
- sessionFutures for jetty and javax are now implemented using the
futureCoreSession which will occur after onOpen
- the request and response are set on the FrameHandler before the
upgrade
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
the client and server subclasses of JavaxWebSocketContainer now
share a common configuration instance which is used as the default
configuration for both server and client endpoints
to do this a setter was added for the configuration on the CoreClient
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Reviewed module-info.java files.
For those that have a "requires static" added a comment about
why the dependency is optional.
Rearranged directives in alphabetical order.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Added --add-modules=ALL-MODULE-PATH by default because now Jetty has
proper JPMS modules and when starting in standalone mode only the
org.eclipse.jetty.xml module will be in the module graph - while
before automatic modules where added to the module graph implicitly.
Added --add-reads=ALL-UNNAMED to the websocket module to allow the
websocket implementation to access method handles of application
classes (the websocket endpoints) that live in the web application
classloader (which forms an unnamed module).
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Gave onOpen, onError and onClose callback signatures
Illegal to ask for demand prior to onOpen success
added tests for various onOpen scenarios
Signed-off-by: Greg Wilkins <gregw@webtide.com>
If configure context is called with a context that does not yet have
a server, we should just throw an ISE. This is better than having a
different configuration result depending on if the context has been set
been added to the handler tree or not.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
WebSocketMappings are now stored as attributes in the ContextHandler
init params can be set on the filterHolder to specify what mapping
should be used
the default mapping is stored with attribute key
WebSocketMapping.DEFAULT_KEY and ensureFilter now doesn't ensure there
is an UpgradeFilter registered at "/*" but checks that there is an
UpgradeFilter using the default mapping
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
dont allow duplicate mappings to be added to websocket mapping for javax
succeed the callback in JavaxWebSocketFrameHandler with null messageSink
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Improve on #3167 with major refactor of the context initialization of
websocket:
+ The Javax and Jetty sides are more symmetric - both use shared
filter and mapping.
+ Regularised usage of beans rather than attributes for ws components
+ Customization is now part of the mapping, so ws are configured by
how they were mapped and not by who does the upgrade.
+ Filter still can be configured to customize defaults
+ Servlet can be configured to customize any ws mappings added via the
servlet
There is still some strangeness as the WebSocketServlet is mostly
generic, yet can only map Jetty API websockets.
Signed-off-by: Greg Wilkins <gregw@webtide.com>