Commit Graph

30 Commits

Author SHA1 Message Date
Joakim Erdfelt 9c324326c5
Merge `release/12.0.0` back into `jetty-12.0.x` (#10237)
* Updating to version 12.0.0

* Updating to version 12.0.1-SNAPSHOT
2023-08-08 00:55:19 +02:00
Greg Wilkins 0b1c28a888
Jetty 12 inserted handler in ee10 servlet context (#9927)
This PR refactors the ee10 handing of servlet API request and response objects:

 + The ServletContextHandler matches the request to a servlet and creates a one time only ServletContextRequest and a ServletContextResponse
 + A reusable ServletChannel object with all the heavy weight HttpInput and HttpOutput object is associated with the ServletContextRequest and ServletContextResponse.
 + Once the handling reaches the ServletHandler, the possibly wrapped request, response and callback are associated with the ServletChannel before handling.
 + Were possible the ServletApiRequest and ServletApiResponse use the possibly wrapped request/response

Added tests to check that GzipHandler can now be nested inside of an EE10 context.

---------

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
Signed-off-by: gregw <gregw@webtide.com>
Co-authored-by: Ludovic Orban <lorban@bitronix.be>
2023-06-22 17:04:49 +02:00
Simone Bordet 856d3338f2
Fixes #9391 - port/move Jetty WebSocket APIs, client and server to je… (#9469)
* Moved -api, -common, -client to jetty-core/jetty-websocket.
* Implemented jetty-core/jetty-websocket/jetty-websocket-jetty-server using only Jetty core APIs, not Servlet.
* Fixed Graceful shutdown order.
* Fixed mistakes in HttpFieldsWrapper, wrongly calling HttpHeader.name() instead of asString().
* Updated tests to pass cleanly.
* Fixed BOMs and POM dependencies.
* Introduced websocket-jetty.mod and websocket-jetty-client.mod, now used by ee10's Jetty WebSocket.
* Fixed OSGi references to old artifactIds.
* Added test to show how to lookup and use ServerWebSocketContainer from a Handler.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-03-24 19:42:51 +01:00
Lachlan 81046650ab
Merge pull request #9356 from eclipse/jetty-12.0.x-websocket-JPMS
cleanup of websocket to fix JPMS warnings
2023-02-17 15:30:54 +11:00
Lachlan Roberts 41d550047f ensure the WebSocketConnection is set on the WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 14:05:48 +11:00
Lachlan Roberts 229b300f22 rename WebSocketUtil to WebSocketUtils
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:37:01 +11:00
Lachlan Roberts eb493f1b9d make WebSocketCoreSession public & other fixes
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-17 11:33:02 +11:00
Greg Wilkins 0ca6295cbc
Rename process to handle (#9385)
Renamed Request.Processor to Request.Handler
Renamed Handler.process to Handler.handle
Renamed Rule.Processor to Rule.Handler.
Renamed accordingly methods and variable.
Updated comments accordingly.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2023-02-16 18:21:12 +01:00
Lachlan Roberts 43718f3e52 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-JPMS 2023-02-15 17:12:59 +11:00
gregw a15af55a56 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x
Signed-off-by: gregw <gregw@webtide.com>
2023-02-15 15:31:33 +11:00
Lachlan Roberts 1d8e13220a resolve JPMS issues with CoreSession and WebSocketCoreSession
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-02-14 15:34:53 +11:00
Greg Wilkins f565122571
Redo Handler renaming (#9318)
* Redo Handler renaming

Wrapper to Singleton
BaseWrapper to Wrapper

* Updates from review
2023-02-07 16:41:15 +11:00
Simone Bordet 44980ebfc3
Merge branch 'issue/9284' of https://github.com/kohlschuetter/jetty.project into kohlschuetter-issue/9284 2023-02-06 10:16:32 +01:00
Greg Wilkins 60a08f5349
Rename Handler Nested & Collection (#9305)
There is now a Handler interface hierarchy:
 + Container is a Handler that has 1 or more contained Handlers.
 + Wrapper is a Container with only 1 handler and a setHandler method.
 + Collection is a Container with n handlers and a addHandler method

class are now:
 + Abstract implements Handler
 + AbstractContainer extends Abstract implements Container
 + BaseWrapper extends AbstractContainer implements Wrapper
 + Sequence extends AbstractContainer implements Collection

 Lots of other associated cleanups
2023-02-06 12:15:35 +11:00
Christian Kohlschütter b8ab66fd1d Rename RetainableByteBufferPool to ByteBufferPool
With issue #9166, ByteBufferPool was removed and replaced by
RetainableByteBufferPool. Since ByteBufferPool was used by
AbstractConnector, this change broke backwards compatibility with
third-party connectors such as junixsocket-jetty.

Since there's no longer any other ByteBufferPool, rename the
RetainableByteBufferPool interface, and thereby not only reinstate
compatibility with existing third-party libraries but also save a few
keystrokes.

https://github.com/eclipse/jetty.project/issues/9284

Signed-off-by: Christian Kohlschütter <christian@kohlschutter.com>
2023-02-04 23:39:29 +01:00
Lachlan Roberts 96fc36ca64 fix some jpms issues for websocket-core
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2023-01-31 20:09:51 +11:00
Greg Wilkins c871fa4402
Converted PathMappings to be an AbstractMap (#9213)
This was primarily done to avoid surprise of the previous behaviour of puts for a duplicate key being ignored.
The use of the AbstractMap class now provides javadoc and known/expected behaviour for key methods.
The only significant behaviour change is in the return type of some key methods, with the old/previous value replacing a boolean.
Some stream usage has also been replaced by the more efficient iterator.
2023-01-31 09:19:01 +11:00
Simone Bordet cd732a175c
Review and normalized all Maven module <name> for consistency.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 19:09:30 +01:00
Ludovic Orban 2424c86b34 #9145 fix websocket modules
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2023-01-27 17:44:09 +01:00
Simone Bordet ded18f523d
Fixes #9166 - Jetty 12: review/remove ByteBufferPool (#9195)
* Fixes #9166 - Jetty 12: review/remove ByteBufferPool

* Replaced usages of ByteBufferPool with RetainableByteBufferPool.
* Removed ByteBufferPool and related classes.
* Renamed oej.http2.frames.DataFrame.getData() -> getByteBuffer() for consistency.
* Removed Accumulator.acquire(), and updated code to use RetainableByteBufferPool.acquire() instead.
* Fixed HttpOutput callbacks to correctly call super.onCompleteSuccess() and super.onCompleteFailure().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2023-01-27 13:40:49 +01:00
Greg Wilkins c18e790858
Jetty 12 handler as boolean processor (#9035)
Alternative Handler architecture.

All Handlers are Processors, which now return a boolean to indicate the request has been accepted.
The request/response/callback are no longer modal, so there is no race with the boolean return.

Optimized PathMappings.
Avoid iterations if only ServletPathSpec instances
Avoid tests for empty mappings.
Better reset implementation
Improve suffix matching
Improve exact matching

Renamed HttpStream.getNanoTimeStamp() to getNanoTime().

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
2022-12-19 16:02:26 +01:00
Greg Wilkins 011a7267de
Cleanup ContextHandler (#8928)
* Cleanup ContextHandler

Extracted some of the goodness from #8793:
 + Clear enter/exit scope methods rather than opaque suppliers and Runnables
 + Removed overloading of "Context" class name to avoid accidental usage of wrong type.
 + Less holding onto request/response as fields

* Cleanup ContextHandler

fixed test with no server

* Updates from review.
2022-11-25 14:27:39 +11:00
Greg Wilkins 1885df7e03 WIP replacing getPathInContext with static method 2022-10-23 22:36:15 +11:00
Simone Bordet c785f08b17
[Jetty 12] Made WebSocket over HTTP/2 work. (#8685)
* Made WebSocket over HTTP/2 work.

Re-enabled tests, and restored HTTP2StreamEndPoint,
as well as implemented getTunnelSupport() for HTTP/2.

Removed from HttpStream methods for upgrade that are
not necessary anymore.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-10-07 12:50:42 +02:00
Lachlan Roberts 5296424e0a Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-upgrade-contract 2022-09-19 18:34:49 +10:00
Lachlan Roberts b9d980b5a9 Merge remote-tracking branch 'origin/jetty-11.0.x' into jetty-12.0.x 2022-09-19 16:39:26 +10:00
Lachlan Roberts 206a899629 PR #8413 - add javadoc to Handshaker.isWebSocketUpgradeRequest
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-08-17 16:53:39 +10:00
Lachlan Roberts 9f92b6b7be PR #8413 - changes from review
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2022-08-17 16:34:48 +10:00
Lachlan Roberts 87f2393467 Merge remote-tracking branch 'origin/jetty-12.0.x' into jetty-12.0.x-websocket-upgrade-contract 2022-08-17 16:00:39 +10:00
Simone Bordet 1eea480764
Jetty 12 module renaming - jetty-websocket.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2022-08-12 09:33:31 +02:00