beautypg.com

IBM WebSphere Adapters User Manual

Page 109

background image

this.connection.getResourceAdapter();

ObjectNaming objectNaming = new ObjectNaming(resourceAdapter);
factory = new TwineBallCommandFactory(objectNaming);

commandManager = new CommandManager(factory,

this.connection.getEISConnection(), this.getLogUtils());

}

public Record execute(InteractionSpec ispec, Record inRecord) throws

ResourceException {

WBIRecord wbiRecord = (WBIRecord) inRecord;

String functionName = ((WBIInteractionSpec) ispec).getFunctionName();
WBIInteractionSpec interactionSpec = (WBIInteractionSpec)ispec;
factory.setMaxRecords(interactionSpec.getMaxRecords());
Command topLevelCommand =

commandManager.produceCommands((WBIRecord) inRecord,

functionName);

topLevelCommand.getClass().getName());

DataObject returnDataObject = null;

try {

returnDataObject = interpreter.execute(topLevelCommand);

} catch (ResourceException e) {

log(e);
throw e;

}
WBIRecord outRecord = new WBIRecord();
if (functionName == WBIInteractionSpec.RETRIEVE_ALL_OP) {

outRecord.setDataObject(returnDataObject);

} else {

outRecord.setDataObject(returnDataObject.getContainer());

}
return outRecord;

}

}

WBIInteractionSpec:

A javax.resource.cci.InteractionSpec instance contains properties that identify the
operation to perform on the EIS.

WBIInterationSpec

implements InteractionSpec and provides functionName and

maxRecords properties. Client components set these properties to provide
information to the resource adapter about the EIS operation to perform. For more
information, see the Javadocs for the Adapter Foundation Classes.

EIS specific resource adapter implementations need not extend this class unless
they have more EIS operation-specific properties to be added to the
InteractionSpec.

WBIConnectionRequestInfo:

A javax.resource.spi.ConnectionRequestInfo instance enables a resource adapter to
pass request-specific EIS data structure on a connection request
(ConnectionManager.allocateConnection). Client components can set these using
connection request properties. WBIConnectionRequestInfo implements
ConnectionRequestInfo. See the Adapter Foundation Classes Javadocs for more
information on this implementation.

Configuration properties

WBIConnectionRequestInfo provides userName and password properties. Using
connection properties, subclasses can add their own EIS-specific properties. These

WebSphere Adapter development overview

103