IBM WebSphere Adapters Network Card User Manual


 
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