processed. Acustom function selector can use the information in the
InboundInteractionSpec to generate a native function.
For a custom adapter, you can createeither a smart function selector that utilizes
the data or metadata to perform function selection, with or without configuration;
or you can implement a simple function selector that always returns a static
function name. Implementing a simple function selector restricts your inbound
service to a single function. This, in turn, restricts the service to dealing with a
single data type; unless anyTypeis used in the WSDL, which is discouraged
because a WSDL that contains an anyTypeschema is difficult to use in WebSphere
Process Server or WebSphereESB (due to the fact that it does not indicate the
actual type emitted).
Implementing a data bindingA data binding implements the interface
commonj.connector.runtime.RecordHolderDataBinding. This interface contains four
methods as follows:
vRecord getRecord();
vvoid setRecord(Record record);
vDataObject getDataObject();
vvoid setDataObject(DataObject object);
These methods perform the mediation between the record that the adapter needs
(for example an InputStreamRecord), and the data object specified in the service
(WSDL).
The data binding can call a data handler to perform low-level transformation on an
input stream. The adapter foundation classes provide a base class, named
BaseDataBinding that adapters can extend to handle the low-level details of calling
a data handler. The BaseDataBinding data handler has threemethods as follows:
vInputStream transformToInputStream(DataObject object);
vDataObject transformToDataObject(InputStream stream, QName expectedType);
vvoid setChildDataHandler(Qname bindingConfiguration);
Touse these methods, call setChildDataHandler first with a data handler
configuration, then call one of the transform methods. The expectedType
parameter on transformToDataObject should match the type of the DataObject you
want the transformation to produce. Youcan derive this from the expected type
that the data binding is passed in the BindingContext interface described in the
Binding context and configuration.
Binding context and configurationData handlers, data bindings and function selectors can be context-enabled and
may be configurable.
BindingContext isamix-in interface that provides access to contextual information,
such as the configuration of this binding, the expected type for data handlers and
data bindings and the type of service being used.
The BindingContext interface has several constants and one method as follows:
vvoid setBindingContext(Map context);
WebSphereAdapter development overview 159