11<?xml version =" 1.0" ?>
22<!--
33
4- Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
4+ Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved.
55
66 This program and the accompanying materials are made available under the
77 terms of the Eclipse Public License v. 2.0, which is available at
3131
3232 <para >
3333 This section introduces the JAX-RS Client API, which is a fluent Java based API for communication with RESTful Web
34- services. This standard API that is also part of Java EE 7 is designed to make it very easy to consume a Web service
34+ services. This standard API that is also part of Jakarta EE 9 is designed to make it very easy to consume a Web service
3535 exposed via HTTP protocol and enables developers to concisely and efficiently implement portable client-side solutions
3636 that leverage existing and well established client-side HTTP connector implementations.
3737 </para >
@@ -746,7 +746,7 @@ Client client = ClientBuilder.newClient(clientConfig);</programlisting>
746746 into the &lit.jersey.client.ClientConfig; . The &lit.jersey.grizzly.GrizzlyConnectorProvider; is used as a custom
747747 connector provider in the example above. Please note that the connector provider cannot be registered as a provider
748748 using &lit.jaxrs.core.Configurable; <literal >.register(...)</literal >. Also, please note that in this API has changed
749- in Jersey 2.5, where the &lit.jersey.client.ConnectorProvider; SPI has been introduced in order to decouple client
749+ since Jersey 2.5, where the &lit.jersey.client.ConnectorProvider; SPI has been introduced in order to decouple client
750750 initialization from the connector instantiation. Starting with Jersey 2.5 it is therefore not possible to directly
751751 register &lit.jersey.client.Connector; instances in the Jersey &jersey.client.ClientConfig; . The new
752752 &lit.jersey.client.ConnectorProvider; SPI must be used instead to configure a custom client-side transport connector.
@@ -822,33 +822,33 @@ System.out.println("Now the connection is closed.");</programlisting>
822822 </para >
823823 <para >
824824 To solve injection of a custom type into a client provider instance
825- use &jersey.client.ServiceLocatorClientProvider ; to
825+ use &jersey.client.InjectionManagerClientProvider ; to
826826 extract &hk2.ServiceLocator; which can return the required injection. The following example shows how to utilize
827- &lit.jersey.client.ServiceLocatorClientProvider ; :
827+ &lit.jersey.client.InjectionManagerClientProvider ; :
828828 </para >
829829 <example >
830- <title >ServiceLocatorClientProvider example</title >
830+ <title >InjectionManagerClientProvider example</title >
831831 <programlisting language =" java" linenumbering =" numbered" >public static class MyRequestFilter implements ClientRequestFilter {
832832 // this injection does not work as filter is registered as an instance:
833833 // @Inject
834834 // private MyInjectedService service;
835835
836836 @Override
837837 public void filter(ClientRequestContext requestContext) throws IOException {
838- // use ServiceLocatorClientProvider to extract HK2 ServiceLocator from request
839- final ServiceLocator locator = ServiceLocatorClientProvider.getServiceLocator (requestContext);
838+ // use InjectionManagerClientProvider to extract InjectionManager from request
839+ final InjectionManager injectionManager = InjectionManagerClientProvider.getInjectionManager (requestContext);
840840
841841 // and ask for MyInjectedService:
842- final MyInjectedService service = locator.getService (MyInjectedService.class);
842+ final MyInjectedService service = injectionManager.getInstance (MyInjectedService.class);
843843
844844 final String name = service.getName();
845845 ...
846846 }
847847}</programlisting >
848848 </example >
849849 <para >
850- For more information see javadoc of &jersey.client.ServiceLocatorClientProvider ;
851- (and javadoc of &jersey.common.ServiceLocatorProvider ; which supports common JAX-RS components).
850+ For more information see javadoc of &jersey.client.InjectionManagerClientProvider ;
851+ (and javadoc of &jersey.common.InjectionManagerProvider ; which supports common JAX-RS components).
852852 </para >
853853 </section >
854854
@@ -897,7 +897,7 @@ Client client = ClientBuilder.newBuilder().sslContext(sslContext).build();</prog
897897 A behaviour of &jdk6.HostnameVerifier; is dependent on an http client implementation.
898898 &lit.jersey.client.HttpUrlConnectorProvider; and &lit.jersey.apache.ApacheConnectorProvider; work properly, that means that after
899899 the unsuccessful URL verification &lit.jdk6.HostnameVerifier; is called and by means of it is possible to
900- revalidate URL using a custom implementation of &lit.jdk6.HostnameVerifier; and go on in a handskahe processing.
900+ revalidate URL using a custom implementation of &lit.jdk6.HostnameVerifier; and go on in a handshake processing.
901901 &lit.jersey.jetty.JettyConnectorProvider; and &lit.jersey.grizzly.GrizzlyConnectorProvider; provide only host URL verification
902902 and throw a &lit.jdk6.CertificateException; without any possibility to use custom &lit.jdk6.HostnameVerifier; .
903903 Moreover, in case of &lit.jersey.jetty.JettyConnectorProvider; there is a property
@@ -923,12 +923,11 @@ Client client = ClientBuilder.newBuilder().sslContext(sslContext).build();</prog
923923 <para >Jersey supports Basic and Digest HTTP Authentication.</para >
924924 <important >
925925 <para >
926- In version prior to Jersey 2.5 the support was
927- provided by <literal >org.glassfish.jersey.client.filter.HttpBasicAuthFilter</literal >
928- and <literal >org.glassfish.jersey.client.filter.HttpDigestAuthFilter</literal >. Since Jersey
929- 2.5 these filters are deprecated (and removed in 2.6) and both authentication methods
930- are provided by single &lit.jaxrs.core.Feature;
926+ In version of Jersey 3.x both authentication methods are provided by single &lit.jaxrs.core.Feature;
931927 &jersey.client.HttpAuthenticationFeature; .
928+ For migration of older applications: <literal >org.glassfish.jersey.client.filter.HttpBasicAuthFilter</literal >
929+ and <literal >org.glassfish.jersey.client.filter.HttpDigestAuthFilter</literal > shall be replaced by
930+ those two authentication methods.
932931 </para >
933932 </important >
934933
0 commit comments