IBM WebSphere Application ServerTM
Release 7

com.ibm.wbiserver.cmpa
Interface WSPushDownHelper

All Known Subinterfaces:
WSProceduralPushDownHelper, WSRelationalPushDownHelper

public interface WSPushDownHelper

This interface provides helper methods that can be used by customers in their implementations of their <beanName>UserDefinedPushDownMethods classes.

Since:
WBI-SF 5.1

Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 javax.resource.cci.IndexedRecord createCCIIndexedRecord()
          This method returns an empty IndexedRecord object that the caller will need to fill in with the appropriate data (which will be handled by the generated extractor).
 javax.resource.cci.Record createCCIRecord(java.lang.Object obj)
          This method returns a CCI Record object containing the specified object.
 javax.resource.ResourceException createResourceException(java.lang.String message, java.lang.Class c)
          This method creates a ResourceException containing the specified message.
 javax.resource.ResourceException createResourceException(java.lang.Throwable t, java.lang.Class c)
          This method creates a ResourceException which chains the specified Throwable.
 void returnCCIIndexedRecord(javax.resource.cci.IndexedRecord record)
          This method returns the specified IndexedRecord object to the cache.
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

createResourceException

javax.resource.ResourceException createResourceException(java.lang.Throwable t,
                                                         java.lang.Class c)

This method creates a ResourceException which chains the specified Throwable.

Methods of UserDefinedPushDownMethodsImpl are only allowed to throw ResourceException. If users want to rethrow a particular exception which is not a ResourceException, they have to catch that exception, call this method to create a ResourceException object, and throw this ResourceException.

Parameters:
t - a Throwable to be chained into the ResourceException
c - the caller class. This is used to trace which UserDefinedPushDownMethods implementation class throws the ResourceException.
Returns:
a ResourceException object
Since:
WBI-SF 5.1

createResourceException

javax.resource.ResourceException createResourceException(java.lang.String message,
                                                         java.lang.Class c)

This method creates a ResourceException containing the specified message. This is for cases where a ResourceException needs to be thrown from somewhere other than a catch block. For example, if the push down method returns an error return code instead of an exception, the user can translate this error code into meaningful text and use this ResourceException to return this message text.

Methods of UserDefinedPushDownMethodsImpl are only allowed to throw ResourceException. If users want to rethrow a particular exception which is not a ResourceException, they have to catch that exception, call this method to create a ResourceException object, and throw this ResourceException.

Parameters:
message - the String that the ResourceException should contain
c - the caller class. This is used to trace which UserDefinedPushDownMethods implementation class throws the ResourceException.
Returns:
a ResourceException object
Since:
WBI-SF 5.1

createCCIRecord

javax.resource.cci.Record createCCIRecord(java.lang.Object obj)
                                          throws javax.resource.ResourceException

This method returns a CCI Record object containing the specified object.

Parameters:
obj - The object to be wrapped in the CCI Record. For a "finder" pushdown method whose stored procedure returns a java.sql.ResultSet whose rows are already of the required shape, this helper method should be used to wrap that ResultSet in a CCI Record suitable for return from the "finder" method. For a "data logic" pushdown method which returns an Object, this helper method should be used to wrap the Object in a CCI Record suitable for return. Note that the Object returned for a "data logic" method cannot be a ResultSet or any other JDBC object which becomes invalid when the JDBC Connection is closed, since for "data logic" methods the Connection is closed prior to return to the calling application.
Returns:
A CCI Record containing the specified object
Throws:
javax.resource.ResourceException - thrown if obj is null
Since:
WBI-SF 5.1

createCCIIndexedRecord

javax.resource.cci.IndexedRecord createCCIIndexedRecord()
                                                        throws javax.resource.ResourceException

This method returns an empty IndexedRecord object that the caller will need to fill in with the appropriate data (which will be handled by the generated extractor). For "finder" pushdown methods whose backend function (stored procedure, CICS or IMS function, etc.) does not return a java.sql.ResultSet with the required shape, this helper method should be used to create the IndexedRecords which the finder code assembles into a "Record of Records" of the required shape.

"Data logic" methods should NOT use this helper method, they should instead use createCCIRecord(Object)

Returns:
An empty CCI IndexedRecord
Throws:
javax.resource.ResourceException - thrown if an IndexedRecord could not be created.
Since:
WBI-SF 5.1

returnCCIIndexedRecord

void returnCCIIndexedRecord(javax.resource.cci.IndexedRecord record)
                            throws javax.resource.ResourceException

This method returns the specified IndexedRecord object to the cache. Use this method only if you know that this IndexedRecord is no longer used and can be safely returned back to the cache and readied for future use.

Parameters:
record - The CCI IndexedRecord to return to the cache
Throws:
javax.resource.ResourceException - thrown if the IndexedRecord could not be returned to the cache.
Since:
WBI-SF 5.1

IBM WebSphere Application ServerTM
Release 7