IBM WebSphere Adapters User Manual page 169

Version 6 release 2
Table of Contents

Advertisement

Initialize input method
This method resolves the type of the metadata if it's a JavaBean or SDO type and
initializes the metadata interfaces appropriately. public void
initializeInput(DataExchangeFactory dataBinding, Object metadata) throws
DESPIException .
Purpose of the initialize input method
Implement the initializeInput method only if the metadata contains information
to be used to initialize the back-end connection for processing the request. For
example, if an application requires you to instantiate a corresponding component
on the back-end application to process the request.
This method should first invoke super.initializeInput() to initialize the cursors,
accessors and metadata.
Sample code
Here is a coding sample on how to implement the intitializeInput method:
public void initializeInput(DataExchangeFactory factory, Object[] metadata) throws DESPIException {
super.initializeInput(factory, metadata);
objectNaming = new ObjectNaming();
objectSerializer = new ObjectSerializer(objectNaming);
try{
objectAnnotations = super.getMetadata()
.getAnnotations(
TwineBallConstants.METADATA_NAMESPACE);
} catch(Exception e){
throw new DESPIException(e);
}
}
Initialize output method
public void initializeOutput(DataExchangeFactory dataBinding, Object
metadata) throws DESPIException.
Purpose of the initialize output method
Implement this method if there is some initialization needed to support record
retrieval from getNext().
This method should first invoke super.initializeInput() to initialize the cursors,
accessors and metadata.
Sample code
Here is a coding sample on how to implement the intitializeOutput method:
public void initializeOutput(DataExchangeFactory factory, Object[] metadata) throws DESPIException {
super.initializeOutput(factory, metadata);
objectNaming = new ObjectNaming();
objectSerializer = new ObjectSerializer(objectNaming);
try{
objectAnnotations = super.getMetadata().getAnnotations(TwineBallConstants.METADATA_NAMESPACE);
}catch(Exception e){
throw new DESPIException(e);
}
}
WebSphere Adapter development overview
163

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Websphere adapter toolkit

Table of Contents