Developing server providers
interface defines a component that is capable of acting as a server for an external
client. This document explains how to implement and deploy a custom server provider.
All requests that are processed in a JDisc application are created by server
providers. These are the parts of the JDisc Container that accept incoming connections.
Upon accepting a request from an external client, the server provider must create
and dispatch a corresponding
com.yahoo.jdisc.Request instance. Upon
com.yahoo.jdisc.Response, the server needs to respond
back to the client.
To implement a server provider, either implement the
interface directly, or subclass the more convenient
Please note the following:
- All server providers require a local reference
CurrentContainer. Declare that as a constructor argument (which triggers injection), and store it locally.
- All requests dispatched by a server provider should be "server" requests (i.e.
true). To create such a request, use this constructor.
- The code necessary to dispatch a request and write its content into the
ContentChannelis the same as for dispatching a client request from a request handler.
- The code necessary to handle the response and its content is the same as for handling a client response in a request handler.
<container id="default" version="1.0"> <server id="my.package.MyServerProvider" bundle="MyBundleSymbolicName" /> <nodes> <node hostalias="node1" /> </nodes> </container>