Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "RAP/AdapterRegistry"

< RAP
(Adapter API)
Line 16: Line 16:
 
= Adapter API =
 
= Adapter API =
  
An adapter is a plain JavaScript object that has to implement a specific API. Some of it is optional, as the processer will fall back on a default behavior when missing. However, if that default behavior is not supported by the actual client object
+
An adapter is a plain JavaScript object that has to implement a specific API. Some of it is optional, as the processer will fall back on a default behavior when missing. However, that default behavior has to be supported by the actual client object. The adapter is not validated on registration. If a required field is missing or has the wrong type,
 +
the client will crash when the adapter is used by the message processor.
 +
 
 +
 
 +
{| align="left" width="100%" height="73" cellspacing="0" cellpadding="3" border="1" style="margin: auto auto 1em auto;"
 +
|-
 +
! colspan = "4" bgcolor="#CCCCFF" style = "font-family:serif;font-size:16pt" | <b>Protocol Adapter Fields</b>
 +
|-
 +
! <b>Name</b>
 +
! <b>Format</b>
 +
! <b>Description</b>
 +
! <b>Required?</b>
 +
|- valign="top"
 +
| <code>factory</code>
 +
| <code>Function</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| for all create operations
 +
|- valign="top"
 +
| <code>destructor</code>
 +
| <code>Function</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| optional
 +
|- valign="top"
 +
| <code>properties</code>
 +
| <code>[ string * ]</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| for all set operations
 +
|- valign="top"
 +
| <code>propertyHandler</code>
 +
| <code>{ string : function * }</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| optional
 +
|- valign="top"
 +
| <code>listener</code>
 +
| <code>[ string * ]</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| for all listen operations
 +
|- valign="top"
 +
| <code>listenerHandler</code>
 +
| <code>{ string : function * }</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| optional
 +
|- valign="top"
 +
| <code>methods</code>
 +
| <code>[ string * ]</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| for all call operations
 +
|- valign="top"
 +
| <code>methodHandler</code>
 +
| <code>{ string : function * }</code>
 +
| TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC
 +
| optional
 +
|}

Revision as of 12:28, 24 October 2012

Overview

The rwt.protocol.AdapterRegistry object stores all protocol adapters known to the client. A protocol adapter is needed by the clients message processor for all types of targets used in a given RAP protocol message. It basically translates the API of the 'virtual' object referenced by the protocol message to the API of the actual client object. If a message contains a create operation for an unkown type (no matching adapter registered), the client will crash.

Note: The follwing describes only the API required to write additional widgets. Any undocumented functions and features should never be used outside the web client core.

Function Summary
undefined add( string key, Adapter adapter )
stores the given adapter. The key has to match the type string used in a RAP protocol create operation.


Adapter API

An adapter is a plain JavaScript object that has to implement a specific API. Some of it is optional, as the processer will fall back on a default behavior when missing. However, that default behavior has to be supported by the actual client object. The adapter is not validated on registration. If a required field is missing or has the wrong type, the client will crash when the adapter is used by the message processor.


Protocol Adapter Fields
Name Format Description Required?
factory Function TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC for all create operations
destructor Function TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC optional
properties [ string * ] TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC for all set operations
propertyHandler { string : function * } TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC optional
listener [ string * ] TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC for all listen operations
listenerHandler { string : function * } TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC optional
methods [ string * ] TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC for all call operations
methodHandler { string : function * } TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC TODOC optional

Back to the top