IBM WebSphere Adapters Network Card User Manual


 
Set managed connection method
This method passes the ManagedConnection handle to the record implementation,
allowing the record to get access to the physical connection to the backend
application to perform processing.public void setManagedConnection(
ManagedConnection managedConnection) throws ResourceException
Purpose of the set managed connection method
This method is called after initializeInput().
Implement this only if there is a need for to build a component on the backend EIS
to perform an adapter function. For example, if the backend application needs to
initialize a corresponding component on the backend EIS, use this method to
initialize that component.
Sample code
Here is a coding sample on how to implement the setManagedConnection method:
public void setManagedConnection(
ManagedConnection managedConnection) throws ResourceException {
try {
this.managedConnection = managedConnection;
if (this.getEISRepresentation() == null) {
//get the handle to physical connection
BackEndConnection conn =
managedConnection.getBackEndHandle();
Object object = conn.create(name);
if (object == null) {
throw new ResourceException("Invalid metadata defined for the input Data.");
}
//set the instantiated object, would be accessed later
this.setEISRepresentation(object);
}
} catch (Exception e) {
throw new ResourceException("Failed in creating object " + name);
}
}
Get next method
The client application invokes this method to retrieve data through the adapter. For
outbound processing, this method is used to get the response data back from the
adapter. For inbound processing, this method is called to get the inbound data
from the adapter.public boolean getNext(boolean copyValues) throws
DESPIException
Purpose of the getNext method
Use the argument copyValues to fill in values as part of getNext.
When the value for copyValues is set to True, the getNext() method should fill in
data in output cursors as part of the call.
When the value for copyValues is set to False, the getNext() method should just
keep the instance of cursors ready, but not fill in the data. The data would be filled
in using the pushValue() call, which passes an Xpath expression.
This method can be called multiple times by the client application if the operation
can return multiple records from the backend application. For example, if
164 WebSphere Adapters: WebSphere Adapter Toolkit User Guide