About this task
The presentation handler is responsible for rendering a result or
exception to the device. To create the presentation handler for your new device
channel, inherit from the abstract class DSEPresentationHandler class, which
implements the PresentationHandler interface.
After your presentation handler
has been designed, it must be registered in the toolkit configuration file
(server btt.xml), using the presentationHandler field ID.
The
presentation handler must perform the following tasks:
- Process the session reply. The presentation handler must be able to render
a response to the device for the request to establish a session. For example,
this may include information about the status, session ID, and timeout values
to be used by future communications.
- Process the reply. The presentation handler must be able to render a response
to the device in order for the request to perform an operation. For example,
this may include information about the status, session ID, response data,
and reply format.
- Process exceptions. The presentation handler must be able to render a
response to the client that a request has resulted in an exception on the
server. For example, an HTML client may be redirected to an error page.
- Handle an exception. The presentation handler should log exceptions to
the server Trace Facility if unable to render the response to the device.
The following table briefly describes the methods of the PresentationHandler
interface:
Table 1. RequestHandler interface methodsMethod |
Description |
void processRequest(ChannelContext channelContext) |
Handles a request to execute an operation. The method
should remain unchanged to define the process flow of the request handler;
use the protected methods to specialize the implementation. |
void processSessionRequest( ChannelContext channelContext) |
Handles a request to create and establish a channel
session. The method should remain unchanged to define the overall flow; use
the protected methods to specialize the implementation. |