dev@wadl.java.net

Re: Patch: Jersey Client Backend

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Tue, 18 Nov 2008 15:58:36 -0500

Thanks for the patch. I'm a bit tied up this week but I'll try to take
a look towards the end of the week or early next week.

Thanks,
Marc.

On Nov 18, 2008, at 2:54 PM, Jorge L Williams wrote:

>
> Hey guys,
>
> The following patch allows WADL2Java clients to use the Jersey-
> Client library as a backend. This replaces the URLConnection based
> backend that currently exists. Using Jersey allows access for a fair
> amount of configurability. There's a new class (ClientConfigurator)
> that allows the developer to specify a root ClientHandler and a
> ClientConfig (see JavaDoc for jersey-client). When used in
> conjunction with the HttpClient backend for Jersey a developer can
> gain access to new features such as preemptive authentication.
>
> Here's how I setup my WADL2Java client:
>
> DefaultHttpClientConfig clientConfig = new DefaultHttpClientConfig();
>
> clientConfig.setCredentials (null, "host.inel.gov", 443, username,
> password);
> clientConfig.getProperties().put
> (HttpClientConfig.PROPERTY_PREEMPTIVE_AUTHENTICATION, Boolean.TRUE);
>
> ClientConfigurator.setClientHandler(new HttpClientHandler());
> ClientConfigurator.setClientConfig (clientConfig);
>
> Note, this is based on the HttpClient backend which I've submitted
> as a separate patch to the Jersey developer mailing list.
>
> The client config and handler can change between requests.
>
> A developer is not required to use ClientConfigurator at all. If
> it's not used, a WADL client will use a default root ClientHandler,
> which uses URLConnection, with a default ClientConfig. For the most
> part, developers will not notice a difference between this backend
> and the previous one. The only big difference is that WADL
> resource calls used to throw MalformedURLExceptions and IOExceptions
> and they now throw URISyntaxExceptions and UniformInterfaceExceptions.
>
> -jOrGe W.
>
>
> <
> jerseyclient
> .patch
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_wadl.dev.java.net
> For additional commands, e-mail: dev-help_at_wadl.dev.java.net

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.