类 MappingRecordOperation
- java.lang.Object
- org.springframework.jca.cci.object.EisOperation
- org.springframework.jca.cci.object.MappingRecordOperation
- 所有已实现的接口:
InitializingBean
- 直接已知子类:
MappingCommAreaOperation
public abstract class MappingRecordOperation extends EisOperation
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)
andextractOutputData(Record)
methods, to create an input Record from an object and to convert an output Record into an object, respectively.- 从以下版本开始:
- 1.2
- 作者:
- Thierry Templier, Juergen Hoeller
- 另请参阅:
createInputRecord(javax.resource.cci.RecordFactory, Object)
,extractOutputData(javax.resource.cci.Record)
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected class
MappingRecordOperation.RecordCreatorImpl
Implementation of RecordCreator that calls the enclosing class'screateInputRecord
method.protected class
MappingRecordOperation.RecordExtractorImpl
Implementation of RecordExtractor that calls the enclosing class'sextractOutputData
method.
构造器概要
构造器 构造器 说明 MappingRecordOperation()
Constructor that allows use as a JavaBean.MappingRecordOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected abstract Record
createInputRecord(RecordFactory recordFactory, Object inputObject)
Subclasses must implement this method to generate an input Record from an input object passed into theexecute
method.Object
execute(Object inputObject)
Execute the interaction encapsulated by this operation object.protected abstract Object
extractOutputData(Record outputRecord)
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for theexecute
method.void
setOutputRecordCreator(RecordCreator creator)
Set a RecordCreator that should be used for creating default output Records.从类继承的方法 org.springframework.jca.cci.object.EisOperation
afterPropertiesSet, getCciTemplate, getInteractionSpec, setCciTemplate, setConnectionFactory, setInteractionSpec
构造器详细资料
MappingRecordOperation
public MappingRecordOperation()
Constructor that allows use as a JavaBean.
MappingRecordOperation
public MappingRecordOperation(ConnectionFactory connectionFactory, InteractionSpec interactionSpec)
Convenient constructor with ConnectionFactory and specifications (connection and interaction).- 参数:
connectionFactory
- ConnectionFactory to use to obtain connections
方法详细资料
setOutputRecordCreator
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.
execute
public Object execute(Object inputObject) throws DataAccessException
Execute the interaction encapsulated by this operation object.- 参数:
inputObject
- the input data, to be converted to a Record by thecreateInputRecord
method- 返回:
- the output data extracted with the
extractOutputData
method - 抛出:
DataAccessException
- if there is any problem- 另请参阅:
createInputRecord(javax.resource.cci.RecordFactory, java.lang.Object)
,extractOutputData(javax.resource.cci.Record)
createInputRecord
protected abstract Record createInputRecord(RecordFactory recordFactory, Object inputObject) throws ResourceException, DataAccessException
Subclasses must implement this method to generate an input Record from an input object passed into theexecute
method.- 参数:
inputObject
- the passed-in input object- 返回:
- the CCI input Record
- 抛出:
ResourceException
- if thrown by a CCI method, to be auto-converted to a DataAccessExceptionDataAccessException
- 另请参阅:
execute(Object)
extractOutputData
protected abstract Object extractOutputData(Record outputRecord) throws ResourceException, SQLException, DataAccessException
Subclasses must implement this method to convert the Record returned by CCI execution into a result object for theexecute
method.- 参数:
outputRecord
- the Record returned by CCI execution- 返回:
- the result object
- 抛出:
ResourceException
- if thrown by a CCI method, to be auto-converted to a DataAccessExceptionSQLException
DataAccessException
- 另请参阅:
execute(Object)