Developing client providers
interface defines a component that is capable of acting as a client to an external
server. This document explains how to implement and deploy a custom client provider.
The client providers of a JDisc application manage all outgoing requests made to
remote services. Upon receiving a
com.yahoo.jdisc.Request, it initiates
a corresponding connection to the appropriate remote server. Once the remote server
responds, the client provider instantiates and dispatches a corresponding
To implement a client provider, either implement the
interface directly, or subclass the more convenient
Please note the following:
- The code necessary to handle a request and its content is the same as for handling a request in a request handler.
- The code necessary to dispatch a response and write its content into the
ContentChannelis the same as for dispatching a response from a request handler.
<container id="default" version="1.0"> <client id="my.package.MyClientProvider" bundle="MyBundleSymbolicName"> <binding>http://*/*</binding> </client> <nodes> <node hostalias="node1" /> </nodes> </container>Notice that the
bindingelement declared within a
clientelement implies a client-binding. To configure a server-binding for a client, use the