Commit Graph

2717 Commits

Author SHA1 Message Date
Greg Wilkins dc939d753a
Issue #3804 - Update Decorator integration for various CDI implementations (#3838)
* Jetty Issue #3804 WELD-2587

Support CDI integration:
 + cdi2 module exposes jetty APIs
 + cdi module uses DecorationListener

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

* Jetty Issue #3804 WELD-2587

Remove DecoratingListener tests from test-jetty-webapp

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

* improve CDI test

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

* Jetty Issue #3804 WELD-2587

Reverted test to use released CDI and cdi2 module for now.
To test new mechanism, you need to build the weld snapshot locally,
rebuild and switch to cdi module

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

* remove cdi2 webapp references

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

* document attribute

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

* improved documentation

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

* logging

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

* improved javadoc

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

* Fixed version

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

* Reverted to also provide the DecoratingListener in the decorate module.
Renamed cdi-demo to weld-cdi-demo

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

* revert from Weld SNAPSHOT

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

* test all 3 weld integrations

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

* updated destory implementation to release creationalcontext

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

* reverted to released Weld version

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

* Issue #3804 CDI integration

dispose and release context in destroy

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

* Improved CDI module documentation

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

* WIP on OWB

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

* Updates from review
Parameterised CDITests

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

* share webapp resources for cdi webapp test

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* Initialize OWB with a SCI so that listeners can be decorated

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

* Added OwbDecorator so that cdi2 module can be tested with OWB

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

* Lookup attribute name

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

* Cleanups

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

* Cleanup from Review

Don't do lazy bindings

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

* Cleanup from Review

Treat partial CDI same as no CDI

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

* fix maven it test no more need of weld-servlet

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* cleanup it parent pom removing non needed weld servlet

Signed-off-by: olivier lamy <oliver.lamy@gmail.com>

* upgraded to Weld 3.1.2.Final

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

* Cleanup from Review

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

* Cleanup from Review

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-08-08 04:04:07 +02:00
Simone Bordet 2e2cde69e9
Merge pull request #3899 from eclipse/jetty-9.4.x-3856-maxForm_contentLength_behavior
Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
2019-08-07 19:46:49 +03:00
Joakim Erdfelt cb87d7049e
Merge pull request #3923 from eclipse/jetty-9.4.x-3906-seekablebytechannel-fallback
Issue #3906 - Handling SeekableByteChannel.position(long) Exception
2019-08-07 07:43:16 -05:00
Simone Bordet fa0e7850be
Merge pull request #3938 from eclipse/jetty-9.4.x-3929-http2_deadlock_stopping_server
Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop().
2019-08-07 12:34:15 +03:00
Simone Bordet b9b79a6ad7 Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop().
Code cleanup.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 10:51:27 +02:00
Simone Bordet 4b7ba20aae Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop().
Updated code after review.
Now a managed failed bean is restarted if its container is restarted.
Added more test cases.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 10:44:04 +02:00
Simone Bordet 1fd24b3fca Fixes #3940 - Double initialization of Log.
Removed LOG field, it was used improperly (log and rethrow)
and it's now unnecessary.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 10:04:52 +02:00
Simone Bordet 632e9c57a8 Fixes #3940 - Double initialization of Log.
Restructured the class and cleaned up the code.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 10:04:07 +02:00
Simone Bordet 689e6d71a2 Fixes #3940 - Double initialization of Log.
Removed usage of StringUtil.
Moved fields together at top of the class to avoid
class initialization ordering issues.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-07 09:59:23 +02:00
Simone Bordet f484b83c2e Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop().
Added test case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-06 11:50:29 +02:00
Simone Bordet 6c1b5982a5 Fixes #3929 - Deadlock between new HTTP2Connection() and Server.stop().
Previously beans were started if they were not running, which
included them being in a STOPPING state.
Now beans are only started if they are in STOPPED state.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-05 21:08:55 +02:00
Simone Bordet 2488c9611f Merged branch 'jetty-9.4.x' into 'jetty-9.4.x-3856-maxForm_contentLength_behavior'. 2019-08-02 19:13:35 +02:00
Simone Bordet 42815a781b Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Updated code to reflect reviews.
Now lookup of system properties and server attributes is done in
ContextHandler.doStart(), so that the getter always return the
actual value (and this is good for JMX too).

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-08-02 19:12:49 +02:00
Joakim Erdfelt c2f76a6be5 Issue #3906 - Handling SeekableByteChannel.setPosition() Exception
+ UnsupportedOperationException now triggers a fallback seek mode

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-31 14:36:16 -05:00
Olivier Lamy 6b07bd23c8
Issue #3918 use Jetty version from pom if not found (#3919)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-31 20:11:20 +10:00
Joakim Erdfelt 95298d89e9
Merge pull request #3910 from eclipse/jetty-9.4.x-3840-pathresource-byterange
Issue #3840 Static resource byte-range support performance
2019-07-30 20:04:06 -05:00
Joakim Erdfelt dc4b7b1791
Merge pull request #3889 from eclipse/jetty-9.4.x-3888-huge-resources
Issue #3888 - Huge file Resources behaviors
2019-07-30 20:03:34 -05:00
Joakim Erdfelt 7a867c0ff0 Issue #3840 - Applying ByteBuffer niggle from PR review
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 19:59:49 -05:00
Joakim Erdfelt 43f9553a5e Issue #3840 - Adding more robust PathResource.writeTo()
+ Using techniques from SeekableByteChannelRangeWriter
  with variant for -1 count parameter

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 17:12:07 -05:00
Joakim Erdfelt fd9ec22876 Issue #3840 - Adding Default FileSystem check to PathResource
+ Construction of PathResource now tests if path belongs
  to the Default FileSystem or not.  This important info
  for later actions against the PathResource that would
  need to know the File object for the Path object.
  Non-Default FileSystem == null
  Default FileSystem == Path.toFile()

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-30 13:58:09 -05:00
Joakim Erdfelt 8601baa3cc Issue #3804 - PathResource should not use SPARSE hint always
+ SPARSE hint only applies to real os file systems or
  default file systems, not for all file systems.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-26 13:32:03 -05:00
Joakim Erdfelt e5bce5f7cd Issue #3840 - Static resource byte-range support performance
+ Reverting toFile().getInputStream() on PathResource
+ Adding RangeWriter concept for managing open resource
  across multiple range writes
+ RangeWriter implementation delegates to HttpContent behaviors
  Lookup is :
  - Direct Buffer
  - Indirect Buffer
  - ReadableByteChannel (as SeekableByteChannel)
  - InputStream
+ Adding unit tests for all RangeWriter implementation to ensure
  that they behave the same way everywhere.
+ Making ResourceService use new RangeWriter implementation
+ Existing DefaultServletRangeTest still works as-is

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-26 12:36:31 -05:00
Simone Bordet 4e0e962747 Fixes #3822 - trustAll will not work on some servers.
Made TRUST_ALL_CERTS implement X509ExtendedTrustManager,
so that it does not get wrapped in sun.security.ssl.AbstractTrustManagerWrapper,
which performs additional trust checks.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-26 15:57:53 +02:00
Joakim Erdfelt 24b2ca4c32 Issue #3906 - Introducing Testcase to demonstrate issue
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-25 11:43:51 -05:00
Simone Bordet 2629961e74 Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Changes after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 22:01:13 +02:00
Simone Bordet d939c9435a Fixes #3856 - Different behaviour with maxFormContentSize=0 if Content-Length header is present/missing.
Fixed zero checks and exception messages.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2019-07-23 15:44:08 +02:00
Joakim Erdfelt 36294ef0da Issue #3888 - Fixing for truncated long to int
+ Allowing CachedHttpContent._contentLengthValue actually hold
  the `long` resource size (for the 4G variant on test)
+ Allowing BufferUtil to not throw Exception if resource length
  is a positive value, but exceeds Integer.MAX_VALUE, opting instead
  to return a null to prevent excessive memory usage. (fixes the 10G
  variant of test)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-07-18 12:13:35 -05:00
Olivier Lamy 433709a977
fix modifier order (#3859)
Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
2019-07-09 17:51:05 +10:00
Lachlan Roberts 50c18798ba Merge remote-tracking branch 'eclipse/jetty-9.4.x' into jetty-9.4.x-300-CompressionPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-07-04 10:19:54 +10:00
Jan Bartel bb7fb48f08
Fix checkstyle warnings for tests. (#3846)
Signed-off-by: Jan Bartel <janb@webtide.com>
2019-07-03 16:42:20 +02:00
Greg Wilkins f84337d5b2
Issue #3840 Slow skip for PathResource (#3845)
Reverted to use FileInputStream

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 11:48:49 +02:00
Greg Wilkins 5c91e44eaf
Issue #3700 better handling of null location (#3837)
Issue #3700 if a location is null then consider if there are inclusions and/or exclusions when matching a class.
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 11:48:09 +02:00
Greg Wilkins 21857f0b81 fixed checkstyle disable style
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-03 08:33:13 +02:00
Lachlan Roberts 325a084422 Issue #300 - improvements to CompressionPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-07-03 11:51:05 +10:00
Greg Wilkins 89e756a21e Fix checkstyle warnings
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-07-02 13:20:48 +02:00
Greg Wilkins a42ad99871 Misc minor checkstyle fixes
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-25 11:13:34 +02:00
Lachlan Roberts 2cf0c8aeb8 Merge remote-tracking branch 'jetty-9.4.x' into jetty-9.4.x-300-CompressionPool
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-25 10:21:43 +10:00
Greg Wilkins 9706d70484
Jetty 9.4.x reformat (#3811)
* Removing Legacy Method Separators
* Restyling branch `jetty-9.4.x`
* Applying changes highlighted by checkstyle
* Applying XML restyling
* Fixing XML codestyle for IntelliJ
* Fixing XML style mistakes
* Revert "Applying XML restyling"
* Updating checkstyle for XML codestyle
* Reformatting pom.xml files
* Fixed empty string from line wraps
* Update intellij style to not do expression relative formatting. Reformatted code based on that.
* Increasing line split on Eclipse IDE Formatter to 512
* Restoring setting on internal default value.
+ IntelliJ will not export settings on things that set to their
  internal default values.
  We want to keep those values as a hedge against future default
  value changes in future releases of IntelliJ.
* Fixing intellij codestyle
* do not allow single line simple methods
* misc checkstyle fixes
* re-exported with correct name and all values

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-24 17:40:30 +02:00
Joakim Erdfelt 1118750139 Issue #3700 - Fixing bad ClasspathPatternTest assumptions
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-21 06:55:59 -05:00
Joakim Erdfelt 075333a627 Merge `jetty-9.4.x` into `jetty-9.4.x-3700-felix-webapp-testing`
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

# Conflicts:
#	jetty-util/src/main/java/org/eclipse/jetty/util/TypeUtil.java
2019-06-20 15:37:48 -05:00
Joakim Erdfelt 8d59302978 Issue #3700 - Reworking getLocationOfClass()
+ Reverting commit against IncludeExcludeSet
+ TypeUtil.getLocationOfClass is now MethodHandle based
+ new ModuleLocation class provides Module behaviors for Java 9+
  Runtimes, and is used by new MethodHandle based getLocationOfClass
+ Jetty 10 doesn't need reflect complexity of ModuleLocation class
  and can be inlined as real code in TypeUtil
+ TypeUtil.getLocationOfClass is only guaranteed to return the
  URI to the container holding the location of the class, or null.
  - The JAR file - most common
  - The Directory - 2nd most common - a classpath dir entry
  - The jrt:// module reference - if a module reference
+ URLResource support for results of getLocationOfClass is deprecated
  (nothing was using it anyway)

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-20 15:35:10 -05:00
Lachlan Roberts e67532372c Issue #300 - ensure Sessions are stopped before CompressionPools
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-20 09:09:20 +10:00
Joakim Erdfelt 5eb3e73400 Issue #3700 - Fixing TypeUtil and IncludeExcludeSet to work with null location
+ TypeUtil.getLocationOfClass() respects Class.getClassLoader() of null
  which means a class belonging to Boot ClassLoader, a Primitive, Void,
  or a dynamic in-memory class.  Using system classloader is incorrect
  and invalid in Java 9+
+ Fixing IncludeExcludeSet.test() to always return TRUE or FALSE
  never null.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
2019-06-18 11:03:06 -05:00
Greg Wilkins cd38756ef5 fixed formatting from merge
Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-18 09:51:54 +02:00
Greg Wilkins 862e6d008e
Jetty 9.4.x 3755 annotation/jndi example cleanup (#3763)
* Issue #3755 Annotation example cleanup

+ Created JettyDistribution class as common utility to locate a jetty distribution for examples.
+ Fixed ServerWithAnnotations to correctly use the test-spec-webapp
+ Added AttributeContainerMap as a better way to treat attribute values as beans. This avoids them appearing twice in a dump and always associates them with their key.
+ Added NamingDump and use it in EnvConfiguration and jetty-plus.xml so that a server dump will contain dumps of the server local tree and each contexts java:comp/env tree
+ Improved the dump format of NamingContext and WebAppContext
+ Improved the toString format of several associated classes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
2019-06-18 09:50:18 +02:00
Lachlan 275f83c1d0
Issue #3785 - fix failures in QTP testLifeCycleStop (#3788)
make sure the jobs are actually run before calling QTP.stop()

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-18 16:01:09 +10:00
Lachlan Roberts 30dc103a12 Issue #300 - manage deflater/inflater pools with ContainerLifeCycle
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-18 12:31:25 +10:00
Joakim Erdfelt f05d6cf9ad Merge remote-tracking branch 'origin/jetty-9.4.x' into jetty-9.4.x-300-CompressionPool 2019-06-14 08:38:08 -05:00
Lachlan Roberts c30c335df3 Issue #300 - shared Inflater/Deflater pools for WebSocket
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2019-06-14 16:20:00 +10:00
Joakim Erdfelt 40e9e053b9
Merge pull request #3768 from eclipse/jetty-9.4.x-3708-stringutil-replace
Issue #3708 - use StringUtil alternatives for known slow JVM impls.
2019-06-13 14:01:35 -05:00