Commit Graph

63 Commits

Author SHA1 Message Date
Lachlan Roberts 387faa7e33 clean up websocket jetty-logging.properties files
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-09-11 18:02:18 +10:00
Joakim Erdfelt 4e80748b3b Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/ClientContainer.java
2019-08-28 15:01:41 -05:00
Greg Wilkins 8f383faf78
Issue #3872 Javax Websocket Packaging (#3873)
* 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>
2019-08-28 10:03:46 +10:00
olivier lamy 6df9ef3a15 Updating to version 10.0.0-SNAPSHOT 2019-07-12 06:54:56 +10:00
olivier lamy 8cbfd51e80 Updating to version 10.0.0-alpha0 2019-07-12 06:54:56 +10:00
olivier lamy a34e641a27 Updating to version 10.0.0-SNAPSHOT 2019-07-11 17:20:27 +10:00
olivier lamy 2e58f2f515 Updating to version 10.0.0-alpha0 2019-07-11 14:19:45 +10:00
Greg Wilkins d744d097de
Checkstyle cleanup (#3847)
* Checkstyle cleanup
* fixed bug from reformat
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 17:24:08 +02:00
Greg Wilkins 9fe27eb8e3 Updated all arrays after merge of #3846
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 17:23:02 +02:00
Greg Wilkins b7a7a53a18
Jetty 10.0.x reformat (#3812)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Removing Legacy Method Separators
* Restyling branch `jetty-10.0.x`
* Applying checkstyle changes
* Applying checkstyle changes
* Applying XML restyling
* Restyling XML in branch `jetty-10.0.x`
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Fixing XML restyling in branch `jetty-10.0.x`
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Revert "Restyling XML in branch `jetty-10.0.x`"

# Conflicts:
#	jetty-xml/src/test/resources/org/eclipse/jetty/xml/configureWithAttr.xml
#	jetty-xml/src/test/resources/org/eclipse/jetty/xml/configureWithElements.xml

* Adding back build-resources
* Reformatting pom.xml files
* Disabling Checkstyle job
* fixed empty string on line wrap
* reformatted with latest intellij style
* misc checkstyle fixes

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:42:39 +02:00
Lachlan Roberts ec4179cf42 fix NPEs in tests from merge
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-20 11:16:45 +10:00
Joakim Erdfelt 22b054e0ef Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/deploy/WebSocketServerContainerInitializer.java
#	jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/BinaryStreamTest.java
#	jetty-websocket/javax-websocket-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserDebugTool.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/NativeWebSocketServletContainerInitializer.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketUpgradeFilter.java
2019-06-19 16:54:19 -05:00
Lachlan 6fcc3d1a77
Issue #3762 - use the default port of 0 for WebSocket tests (#3770)
* 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>
2019-06-13 15:43:19 +10:00
Lachlan 62eedebd17
Issue #3705 - WebSocket upgrade failure and CompletableFuture refactor
* 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>
2019-06-06 08:13:33 +10:00
Lachlan Roberts 5f62e0f2db store shared websocket components as attributes and not beans
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-05-21 18:56:53 +10:00
Lachlan Roberts e31009cb06 WebSocketCoreClient no longer stores configuration and can be shared
configuration moved to ClientUpgradeRequest

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-05-21 11:33:06 +10:00
Lachlan Roberts 0b41386c0d don't allow custom CoreClients to be supplied to JavaxClientContainer
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-05-17 16:54:09 +10:00
Lachlan Roberts 7019c18117 refactor of javax WebSocketContainer configuration
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>
2019-05-16 15:38:12 +10:00
Simone Bordet c578798370 Fixes #3197 - Use jetty specific websocket API jar.
Introduced jetty-javax-websocket-api artifact with proper
OSGi manifest entries and JPMS Automatic-Module-Name.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-05-10 19:33:12 +02:00
lachan-roberts 8360aad619 remove exception stack traces and prints from websocket tests
Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-04-29 13:51:18 +04:00
Simone Bordet ec273b7cf0 Fixes after merge.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-04-03 19:13:19 +02:00
lachan-roberts 037d8b9059 Issue #3165 use add-exports instead of add-opens in javax WS-Server pom
Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-02-22 14:19:37 +11:00
lachan-roberts 58c0808f19 Issue #3165 - fix to javax-websocket-server module issues
Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-02-20 15:15:12 +11:00
Lachlan Roberts 4378f5d08e Issue #3165 - Configure the HttpClient via XmlHttpClientProvider
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-02-19 11:30:30 +11:00
Lachlan Roberts 1e93a46eed Issue #3165 - added test for examples in javax-websocket-server
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-02-19 11:29:10 +11:00
Lachlan Roberts beff8a208e Issue #3165 - rearrange packages for javax-websocket-server tests
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-02-19 11:28:37 +11:00
Simone Bordet b9f89af847 Fixes #3320 - Review Jetty 10 module-info.java.
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>
2019-02-08 17:30:27 +01:00
Simone Bordet 6f7e1e3c48 Fixes #3333 - Jetty 10 standalone cannot start on the module-path.
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>
2019-02-07 17:48:17 +01:00
Simone Bordet cd488c2d7d Merged branch 'jetty-10.0.x' into 'jetty-10.0.x-3162_jetty_servlet_api'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-02-04 23:11:32 +01:00
Joakim Erdfelt c30c8d4339 Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-3162_jetty_servlet_api
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-client/pom.xml
#	jetty-http/pom.xml
#	jetty-http2/http2-client/pom.xml
#	jetty-http2/http2-http-client-transport/pom.xml
#	jetty-http2/http2-server/pom.xml
#	jetty-osgi/test-jetty-osgi/pom.xml
#	jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-with-custom-class.xml
#	jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty.xml
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2Conscrypt.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJavaxWebSocket.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithWebSocket.java
#	jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
#	jetty-quickstart/pom.xml
#	jetty-servlets/pom.xml
#	jetty-util/pom.xml
#	jetty-websocket/javax-websocket-client/pom.xml
#	jetty-websocket/javax-websocket-server/pom.xml
#	jetty-websocket/jetty-websocket-server/pom.xml
#	pom.xml
2019-01-30 11:56:58 -06:00
Lachlan Roberts 684dcd1693 Merge remote-tracking branch 'eclipse/jetty-10.0.x' into jetty-10.0.x-3298-completableFutures 2019-01-30 15:00:01 +11:00
Lachlan Roberts deaaa0bf30 Merge remote-tracking branch 'eclipse/jetty-10.0.x' into jetty-10.0.x-websocketmapping-refactor 2019-01-30 13:49:10 +11:00
Lachlan Roberts b4bd5980aa Issue #3298 - Refactor of upgrade request class names
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-30 10:00:56 +11:00
Greg Wilkins cf0eaecbdc Merge remote-tracking branch 'origin/jetty-10.0.x' into jetty-10.0.x-3290-websocket-onOpen
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-29 10:59:08 +11:00
Greg Wilkins 8b93922d08 Issue #3290 async onOpen, onClose and onError
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>
2019-01-26 15:34:50 +11:00
Lachlan Roberts a8a5e50579 Issue #3139 ContextHandler must be set on server before configureContext
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>
2019-01-25 17:05:26 +11:00
Lachlan Roberts 0c85b3138f rename of WebSocketResources to WebSocketComponents
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-25 11:57:03 +11:00
Lachlan Roberts ececab10ca Issue #3139 - NPE in WebSocketContainerInitializer for jetty10
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-24 17:18:29 +11:00
Lachlan Roberts e98809c990 javax WebSocketMappings now stored in ContextHandler attributes
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>
2019-01-24 15:10:13 +11:00
Lachlan Roberts 15c6f5250d do not set WebSocketMapping in WSUpgradeFilter if already set
the WSUpgradeFilter now has to be registered at "/" or "/*"

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-22 18:17:33 +11:00
Lachlan Roberts 3c2f728574 move check for duplicate mappings to WebSocketMapping class
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-22 18:08:31 +11:00
Lachlan Roberts e1674cf4b6 separate out resources from the WebSocketMapping
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-22 11:39:53 +11:00
Lachlan Roberts 51feef6dcf javax websocket bug fixes, for duplicate mappings, and null messageSinks
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>
2019-01-18 15:19:54 +11:00
Lachlan Roberts bc951030ba cleanup the isEnabledViaContext check in JavaxWebSocket SCI
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-17 12:27:42 +11:00
Greg Wilkins f16789b101 Issue #3167 cleanups after merge (in #2175)
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-16 15:19:36 +11:00
Greg Wilkins 5036893426 Issue #3167 cleanups from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-12 10:30:47 +11:00
Greg Wilkins d89e797a1b Issue #3167 cleanups from review
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-12 10:06:59 +11:00
Greg Wilkins 9b0c8336ba Merge branch 'jetty-10.0.x' into jetty-10.0.x-3167-websocket-mapping
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-10 08:34:33 +11:00
olivier lamy 63f2023e05 happy new year!!
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-01-01 12:17:53 +10:00
Greg Wilkins 8c7c5a5d01 Issue #3167 Improve websocket initialization
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>
2018-12-22 10:30:37 +11:00