public abstract class

MappingRecordOperation

extends EisOperation
java.lang.Object
   ↳ org.springframework.jca.cci.object.EisOperation
     ↳ org.springframework.jca.cci.object.MappingRecordOperation
Known Direct Subclasses

Class Overview

EIS operation object that expects mapped input and output objects, converting to and from CCI Records.

Concrete subclasses must implement the abstract createInputRecord(RecordFactory, Object) and extractOutputData(Record) methods, to create an input Record from an object and to convert an output Record into an object, respectively.

See Also
  • #createInputRecord(javax.resource.cci.RecordFactory, Object)
  • #extractOutputData(javax.resource.cci.Record)

Summary

Nested Classes
class MappingRecordOperation.RecordCreatorImpl Implementation of RecordCreator that calls the enclosing class's createInputRecord method. 
class MappingRecordOperation.RecordExtractorImpl Implementation of RecordExtractor that calls the enclosing class's extractOutputData method. 
Public Constructors
MappingRecordOperation()
Constructor that allows use as a JavaBean.
MappingRecordOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
Public Methods
Object execute(Object inputObject)
Execute the interaction encapsulated by this operation object.
void setOutputRecordCreator(RecordCreator creator)
Set a RecordCreator that should be used for creating default output Records.
Protected Methods
abstract Record createInputRecord(RecordFactory recordFactory, Object inputObject)
Subclasses must implement this method to generate an input Record from an input object passed into the execute method.
abstract Object extractOutputData(Record outputRecord)
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.
[Expand]
Inherited Methods
From class org.springframework.jca.cci.object.EisOperation
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean

Public Constructors

public MappingRecordOperation ()

Constructor that allows use as a JavaBean.

public MappingRecordOperation (ConnectionFactory connectionFactory, InteractionSpec interactionSpec)

Convenient constructor with ConnectionFactory and specifications (connection and interaction).

Parameters
connectionFactory ConnectionFactory to use to obtain connections

Public Methods

public Object execute (Object inputObject)

Execute the interaction encapsulated by this operation object.

Parameters
inputObject the input data, to be converted to a Record by the createInputRecord method
Returns
  • the output data extracted with the extractOutputData method
Throws
DataAccessException if there is any problem

public void setOutputRecordCreator (RecordCreator creator)

Set a RecordCreator that should be used for creating default output Records.

Default is none: CCI's Interaction.execute variant that returns an output Record will be called.

Specify a RecordCreator here if you always need to call CCI's Interaction.execute variant with a passed-in output Record. This RecordCreator will then be invoked to create a default output Record instance.

See Also
  • javax.resource.cci.Interaction#execute(javax.resource.cci.InteractionSpec, Record)
  • javax.resource.cci.Interaction#execute(javax.resource.cci.InteractionSpec, Record, Record)
  • setOutputRecordCreator(RecordCreator)

Protected Methods

protected abstract Record createInputRecord (RecordFactory recordFactory, Object inputObject)

Subclasses must implement this method to generate an input Record from an input object passed into the execute method.

Parameters
inputObject the passed-in input object
Returns
  • the CCI input Record
Throws
if thrown by a CCI method, to be auto-converted to a DataAccessException
DataAccessException
ResourceException
See Also

protected abstract Object extractOutputData (Record outputRecord)

Subclasses must implement this method to convert the Record returned by CCI execution into a result object for the execute method.

Parameters
outputRecord the Record returned by CCI execution
Returns
  • the result object
Throws
if thrown by a CCI method, to be auto-converted to a DataAccessException
DataAccessException
ResourceException
SQLException
See Also