|
20 | 20 | import java.util.Collection; |
21 | 21 | import java.util.Collections; |
22 | 22 | import java.util.List; |
23 | | -import java.util.Properties; |
24 | 23 | import java.util.function.Function; |
25 | 24 |
|
26 | 25 | import jakarta.ws.rs.core.Configuration; |
@@ -57,7 +56,7 @@ final class RuntimeModelBuilder { |
57 | 56 |
|
58 | 57 | // SubResourceLocator Model Builder. |
59 | 58 | private final Value<RuntimeLocatorModelBuilder> locatorBuilder; |
60 | | - private final boolean is2xMethodSelectingRouter; |
| 59 | + private final boolean isWildcardMethodSelectingRouter; |
61 | 60 |
|
62 | 61 | /** |
63 | 62 | * Create a new instance of the runtime model builder. |
@@ -86,8 +85,8 @@ public RuntimeModelBuilder( |
86 | 85 | this.locatorBuilder = Values.lazy((Value<RuntimeLocatorModelBuilder>) |
87 | 86 | () -> new RuntimeLocatorModelBuilder(config, messageBodyWorkers, valueSuppliers, resourceContext, |
88 | 87 | RuntimeModelBuilder.this, modelProcessors, createServiceFunction)); |
89 | | - this.is2xMethodSelectingRouter = ServerProperties.getValue(config.getProperties(), |
90 | | - ServerProperties.EMPTY_REQUEST_MEDIA_TYPE_MATCHES_ANY_CONSUMES, false); |
| 88 | + this.isWildcardMethodSelectingRouter = ServerProperties.getValue(config.getProperties(), |
| 89 | + ServerProperties.EMPTY_REQUEST_MEDIA_TYPE_MATCHES_ANY_CONSUMES, true); |
91 | 90 | } |
92 | 91 |
|
93 | 92 | private Router createMethodRouter(final ResourceMethod resourceMethod) { |
@@ -154,9 +153,9 @@ public Router buildModel(final RuntimeResourceModel resourceModel, final boolean |
154 | 153 | // resource methods |
155 | 154 | if (!resource.getResourceMethods().isEmpty()) { |
156 | 155 | final List<MethodRouting> methodRoutings = createResourceMethodRouters(resource, subResourceMode); |
157 | | - final Router methodSelectingRouter = is2xMethodSelectingRouter |
158 | | - ? new MethodSelectingRouter2x(messageBodyWorkers, methodRoutings) |
159 | | - : new MethodSelectingRouter(messageBodyWorkers, methodRoutings); |
| 156 | + final Router methodSelectingRouter = isWildcardMethodSelectingRouter |
| 157 | + ? new WildcardMethodSelectingRouter(messageBodyWorkers, methodRoutings) |
| 158 | + : new OctetStreamMethodSelectingRouter(messageBodyWorkers, methodRoutings); |
160 | 159 | if (subResourceMode) { |
161 | 160 | currentRouterBuilder = startNextRoute(currentRouterBuilder, PathPattern.END_OF_PATH_PATTERN) |
162 | 161 | .to(resourcePushingRouter) |
@@ -185,9 +184,9 @@ public Router buildModel(final RuntimeResourceModel resourceModel, final boolean |
185 | 184 | srRoutedBuilder = startNextRoute(srRoutedBuilder, childClosedPattern) |
186 | 185 | .to(uriPushingRouter) |
187 | 186 | .to(childResourcePushingRouter) |
188 | | - .to(is2xMethodSelectingRouter |
189 | | - ? new MethodSelectingRouter2x(messageBodyWorkers, childMethodRoutings) |
190 | | - : new MethodSelectingRouter(messageBodyWorkers, childMethodRoutings)); |
| 187 | + .to(isWildcardMethodSelectingRouter |
| 188 | + ? new WildcardMethodSelectingRouter(messageBodyWorkers, childMethodRoutings) |
| 189 | + : new OctetStreamMethodSelectingRouter(messageBodyWorkers, childMethodRoutings)); |
191 | 190 | } |
192 | 191 |
|
193 | 192 | // sub resource locator |
|
0 commit comments