216 WebSphere Business Integration Adapters
Example 14-7 shows the getBoDefs() method for the ODA in our scenario.
Example 14-7 getBoDefs() method
public BusObjDef[] getBoDefs(long index) throws ODKException
{
BusObjDef[] bos = null;
if (index == ODKConstant.GET_ALL_OBJECTS)//were all BOs requested?
{
bos = new BusObjDef[m_generatedBOs.size()];
System.arraycopy(m_generatedBOs.toArray(), 0, bos, 0,
m_generatedBOs.size());
} else bos = new BusObjDef[]
{(BusObjDef)m_generatedBOs.get((int)index)};
return bos;
}
14.3 Testing the ODA
After you have written the application-specific component for the connector, you
must compile it into an executable format, its connector library.
To compile a Java connector:
1. Use a JDK 1.3.1 development environment.
2. Ensure that both of the following files are in the \lib\ subdirectory of the
product directory:
–crossworlds.jar
– WBIA.jar
3. Include crossworlds.jar in the project path. Also, include in the project path
any application-specific .jar (Java archive) files that the application-specific
component requires.
4. Compile the connector source (.java) files into class (.class) files with the
Java compiler.
5. Create the Java connector’s library file, which is a .jar file containing the
compiled Java code.
After coding and compiling the ODA, you can test the ODA in the WebSphere
Studio Development environment.
Note: The source for the ODA in our scenario can be found in the Additional
Materials in the ODA .jar file.