Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change of default behaviour of UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE #4885

Merged
merged 2 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ public final class ServerProperties {
* The {@code CompletionStage} value will be unwrapped and the message body writer will be invoked with the unwrapped type.
*
* <p>
* The default value is {@code false}.
* The default value is {@code true}.
* </p>
* <p>
* The name of the configuration property is <tt>{@value}</tt>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ private Response invoke(final RequestProcessingContext context, final Object res

private Type unwrapInvocableResponseType(ContainerRequest request) {
if (isCompletionStageResponseType
&& request.resolveProperty(ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE, Boolean.FALSE)) {
&& request.resolveProperty(ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE, Boolean.TRUE)) {
return completionStageResponseType;
}
return invocableResponseType;
Expand Down
13 changes: 12 additions & 1 deletion docs/src/main/docbook/appendix-properties.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--

Copyright (c) 2013, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2013, 2021 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -610,6 +610,17 @@
</para>
</entry>
</row>
<row>
<entry>&jersey.server.ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE;</entry>
<entry><literal>jersey.config.server.unwrap.completion.stage.writer.enable</literal></entry>
<entry>
<para>
If <literal>true</literal> or not set, message body writer will not use
<literal>CompletionStage</literal> as a generic type. The <literal>CompletionStage</literal>
value will be unwrapped and the message body writer will be invoked with the unwrapped type.
</para>
</entry>
</row>
<row>
<entry>&jersey.logging.LoggingFeature.LOGGING_FEATURE_LOGGER_NAME_SERVER;
</entry>
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/docbook/jersey.ent
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@
<!ENTITY jersey.server.ServerProperties.WADL_GENERATOR_CONFIG "<link xlink:href='&jersey.javadoc.uri.prefix;/server/ServerProperties.html#WADL_GENERATOR_CONFIG'>ServerProperties.WADL_GENERATOR_CONFIG</link>" >
<!ENTITY jersey.server.ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED "<link xlink:href='&jersey.javadoc.uri.prefix;/server/ServerProperties.html#LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED'>ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED</link>" >
<!ENTITY jersey.server.ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231 "<link xlink:href='&jersey.javadoc.uri.prefix;/server/ServerProperties.html#LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231'>ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_RFC7231</link>" >
<!ENTITY jersey.server.ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE "<link xlink:href='&jersey.javadoc.uri.prefix;/server/ServerProperties.html#UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE'>ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE</link>" >
<!ENTITY jersey.server.Uri "<link xlink:href='&jersey.javadoc.uri.prefix;/server/Uri.html'>Uri</link>">
<!ENTITY jersey.server.UriConnegFilter "<link xlink:href='&jersey.javadoc.uri.prefix;/server/filter/UriConnegFilter.html'>UriConnegFilter</link>">
<!ENTITY jersey.server.WadlFeature "<link xlink:href='&jersey.javadoc.uri.prefix;/server/wadl/WadlFeature.html'>WadlFeature</link>">
Expand Down
36 changes: 32 additions & 4 deletions docs/src/main/docbook/migration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<title>Migration Guide</title>

<section xml:id="mig-3.0.0">
<title>Migrating from Jersey 2.32 to &version;.</title>
<title>Migrating from Jersey 2.32+ to 3.0.x.</title>
<section xml:id="mig-3.0.0-breaking-changes">
<title>Breaking Changes</title>
<para>
Expand All @@ -47,6 +47,9 @@
<para>
Spring for now is not supported.
</para>
<para>
Helidon connector for now is not supported.
</para>
<para>
Examples and tests are reduced in quantity (so you probably will not find all those examples which were available
in the 2.32 version).
Expand All @@ -70,9 +73,34 @@
<section xml:id="mig-3.0.0-application-servers">
<title>Application servers for Jersey</title>
<para>
At the end of the year 2020 only few application servers where supporting Jakarta EE 9.
Those are <literal>GlassFish 6.0.0 (RCx)</literal>, <literal>Tomcat 10 (Mx)</literal> and
<literal>Jetty 11.x (JDK 11+ required)</literal>
Note that only a few servers support Jakarta EE 9 compatible Servlet API and they are tested with Jersey.
Those are:
<literal>GlassFish 6</literal>,
<literal>Grizzly 3</literal>,
<literal>Jetty 11 (JDK 11+ required)</literal>,
<literal>Payara 6</literal>, and
<literal>Tomcat 10</literal>.
</para>
</section>
</section>
<section xml:id="mig-3.1.0">
<title>Migrating from Jersey 3.0.x to &version;.</title>
<section xml:id="mig-3.1.0-breaking-changes">
<title>Breaking Changes</title>
<para>
<itemizedlist>
<listitem>
<para>
Jersey 3.1.0+ is the implementation of Jakarta RESTful WebServices 3.1, which is part of
Jakarta EE 10. Jakarta EE 10 defines the minimum JDK 11 requirement and hence Jersey no longer
supports JDK 8.
</para>
<para>
&jersey.server.ServerProperties.UNWRAP_COMPLETION_STAGE_IN_WRITER_ENABLE; is by default
<literal>true</literal>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
<plugin>
<groupId>org.commonjava.maven.plugins</groupId>
<artifactId>directory-maven-plugin</artifactId>
<version>0.3.1</version>
<version>1.0</version>
<executions>
<execution>
<id>directories</id>
Expand Down