Commit Graph

64 Commits

Author SHA1 Message Date
Greg Wilkins 46a3368f3b
Issue #2578 - Listener behavior cleanup (Jetty 10.0.x) (#3966)
* Avoid creating listener list for rarely used requestAttributeListener

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964

Keep a list of EventListeners in the AbstractConnector to make it
more efficient to add and iterate over them.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

Use addEventListener rather than bespoke listener methods.
Support getEventListenerBeans at Container level for fast lookup
improve javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

fixed test
more javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

fixed tests

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964

Don't use null for empty lists of listeners

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* fix merge

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

Resolve differences between eventListeners added as beans and beans
added as EventListeners.   The behaviour should now be the same
regardless of how they listener is added and all listeners are now
beans.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

Add only SelectorManager listeners to manager from connector

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

Fixed javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

removed old TODO

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

connector cannot be null

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964

AbstractConnector keeps a specific list of HttpChannel.Listeners
to avoid Connection.Listeners and MBean listeners being added to
the HttpChannel listener list.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

fixed merge

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* fixed javadoc

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #2578 EventListener

removed the ability to set/clear context listeners
Instead just remove non-durable ones.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964 Listeners

Simplified listener handling by avoiding null connector, previously
only needed for testing.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* fixed bad merge

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964 Listeners

Fixed test that assumed HttpChannel listeners were not cleared by a recycle

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #3964 Listeners

Separated out durable vs cyclic HttpChannel.Listeners, so as to
simplify handling.

Deprecated cyclic HttpChannel.Listeners, as I'm not sure the channel is
the right place for them.

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* removed deprecated cyclic HttpChannel listeners

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* removed deprecated cyclic HttpChannel listeners - import

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* Issue #4003 Cleanup quickstart

* Fixed tests that scan for "Started" on console

Signed-off-by: Greg Wilkins <gregw@webtide.com>

* updates from review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-11-13 11:04:38 +11:00
Lachlan d0f74c5532
Issue #4124 - autobahn tests for jetty, javax websocket APIs (#4147)
- do not select duplicate extensions in javax default Configurator
- correctly copy payload for ping frames in jetty & javax frame handlers
- add ByteBuffer to javadoc for onMessage in jetty api
- cleaned up some test logging for EventSocket
- add autoFragment and maxFrameSize settings to WebSocketPolicy
- fix early validation for multiple extensions in setExtensions

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-11-07 11:06:14 +11:00
Joakim Erdfelt d7a189fa18 Updating to version 10.0.0-SNAPSHOT 2019-10-03 12:05:26 -05:00
Joakim Erdfelt fd6a2cb9f6 Updating to version 10.0.0.alpha1 2019-10-03 11:25:06 -05: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
Joakim Erdfelt 4829498eab Merge branch `jetty-9.4.x` into `jetty-10.0.x`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/extensions/ExtensionFactory.java
#	jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
#	jetty-websocket/websocket-server/src/main/java/org/eclipse/jetty/websocket/server/WebSocketServerFactory.java
#	jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserDebugTool.java
#	jetty-websocket/websocket-servlet/src/main/java/org/eclipse/jetty/websocket/servlet/WebSocketServletFactory.java
2019-08-28 12:43:11 -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 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 e305736b02 add request and response to JettyWSFrameHandler on server side
wrap exceptions delivered to jetty connect CompletableFuture

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-20 16:47:11 +10: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 372ed1455f
Issue #3661 - review of exposed classes in jetty-websocket-server (#3779)
* Issue #3661 - review of exposed classes in jetty-websocket-server

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>

* Issue #3762 - cleanups of jetty-websocket-server

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-17 17:12:46 +10:00
Lachlan 0d9de28226
Issue #3661 - move WebSocketSessionListener to WebSocket-API
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-11 21:08:52 +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
Greg Wilkins 3e0e6a73c7
Some fixes for running cometd6 on jetty-10 (#3702)
* Some fixes from testing cometd-6

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-05-28 17:08:38 +02: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 455cc3d2e2 improvements to the jetty-websocket configuration testing
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-05-16 15:43:22 +10:00
Lachlan Roberts 717d7300ac adding missing file headers for JettyWebSocketServlets
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-28 16:22:10 +11:00
Lachlan Roberts 81960e3da8 Issue #3484 - make WebSocketServlet generic
WebSocketServlet could only be used with the jetty-websocket-api
make this generic and add implementation in websocket-server

this prevents jetty-websocket-server from needing to use core classes
can cause class cast exceptions from a webapp due conflicts between the
clients version of core classes and those provided by the container

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-28 16:22:10 +11:00
Lachlan Roberts 3c61a92ac8 only protectAndExpose api and server for jetty-websockets
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-28 16:22:10 +11:00
Lachlan Roberts 62406cdfa2 Issue #3458 - missing licence headers and changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-18 15:24:23 +11:00
Lachlan Roberts f60534a8ac Issue #3458 - jetty websocket upgrades with only websocket-server
websocket-servlet exposes core classes as it is used by the jetty and
javax sides, so this introduces a way to add websocket mappings
with jetty-server which does not depend on websocket-servlet

to set websocket mappings through the JettyWebSocketServerContainer
you now need to use the JettyWebSocketCreator which abstracts away
the core classes from use with the jetty websocket api

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-18 15:24:23 +11:00
Lachlan Roberts 86675422a6 Issue #3458 - ExtensionConfig now delegates to core implementation
ExtensionConfig is now interface in jetty-websocket-api and
implemented in jetty-websocket-common, for its static methods it now
uses a ExtensionConfig.Parser found by the ServiceLoader

the api tests were moved to jetty-websocket-tests

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-03-18 15:24:23 +11:00
Greg Wilkins 8b2b626f3c
Merge pull request #3455 from eclipse/jetty-10.0.x-3453-remove-deprecated-websocket-extension-api
Issue #3453 - Removing deprecated Extension classes in jetty-websocket-api
2019-03-13 11:05:47 +11:00
Joakim Erdfelt 8a0fff9153 Issue #3453 - Removing deprecated Extension classes in jetty-websocket-api
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-03-12 10:23:51 -05:00
lachan-roberts 8f727bef40 Issue #3446 - changes from review
use the same FrameHandlerFactory for WebSocketServlet and
WebSocketUpgradeFilter

removed addMapping with PathSpec and only support addMapping
with String

JettyWebSocketServerContainer now implements WebSocketPolicy which
configures the FrameHandler.Customizer

Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-03-12 10:46:22 +11:00
lachan-roberts e355ec31b8 Issue #3446 - renaming, code cleanup and fixes
rename WebSocketSessionImpl to WebSocketSession

remove SessionListener which is unused and replaced by
WebSocketSessionListener

Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-03-11 18:07:52 +11:00
lachan-roberts e9df97e314 Issue #3446 - allow jetty-websocket upgrades with WebSocketUpgradeFilter
JettyWebSocketServerContainer moved out of internal and is now used
in a similar way to the Javax server container, and can now be
used to configure upgrades using the shared mapping with
the WSUpgradeFilter

the JettyWSSCI now works in the same way as the JavaxWSSCI, the
JettyWebSocketEmbeddedStarter has been removed and the configureContext
now returns the JettyWebSocketServerContainer

WebSocket upgrade failures due to exceptions will now be logged as
a warning in WebSocketMapping rather than being ignored

Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-03-11 18:05:44 +11:00
lachan-roberts 265e0be6f7 Issue #3446 - jetty-websocket tests for WebSocketUpgradeFilter
Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-03-11 18:05:44 +11:00
lachan-roberts a01fc193a1 WebSocket code cleanups and renaming
rename JettyWSSCI.configure to configureContext, this is more similar
to the javax equivalent version

introduce helper method getMapping in WebSocketMapping

WebSocketServletFactory now implements FrameHandler.Configuration

changed WebSocketMapping Attribute name in WebSocketUpgradeFilter

Signed-off-by: lachan-roberts <lachlan@webtide.com>
2019-03-11 18:05:44 +11:00
Joakim Erdfelt d8a9f2619b Issue #3379 - Add tracking of WebSocket Sessions to various WebSocket Container APIs
+ Jetty WebSocket API now tracks Sessions and will close them on
  lifecycle stop
+ Javax WebSocket API now tracks Sessions and will close them on
  lifecycle stop
+ Adding Jetty WebSocket tests for proper close / session tracking
+ Disabling tests that need triage

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-02-27 16:26:43 -05: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 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
Lachlan Roberts 0c85b3138f rename of WebSocketResources to WebSocketComponents
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-25 11:57:03 +11:00
Joakim Erdfelt 5095c8a7b2 Issue #3288 - Correcting Jetty WebSocket API artifactIds
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-01-23 15:58:11 -06:00
Lachlan Roberts 74a5cfa190 remove the word default from all WebSocketServletFactory methods
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-22 18:32:14 +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 4008005a0e Jetty WebSockets no longer use shared mapping
mapping is now created for each WebSocketServlet

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-01-22 11:55:18 +11:00
Greg Wilkins 4f570b62e3 BrowserTool enhancements
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-15 16:28:01 +11:00
Greg Wilkins 12655a0944 Working BrowserDebugTool for jetty websocket API
Plus fixes for 10.0.x

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-15 15:54:09 +11:00
Greg Wilkins e1daad1599 Merge branch 'jetty-10.0.x' into jetty-10.0.x-3167-websocket-mapping
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-01-15 13:31:11 +11:00