本文整理汇总了Java中javax.resource.cci.Interaction.execute方法的典型用法代码示例。如果您正苦于以下问题:Java Interaction.execute方法的具体用法?Java Interaction.execute怎么用?Java Interaction.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.resource.cci.Interaction
的用法示例。
在下文中一共展示了Interaction.execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGet
import javax.resource.cci.Interaction; //导入方法依赖的package包/类
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try{
Connection eciConn = cf.getConnection();
Interaction eciInt = eciConn.createInteraction();
JavaStringRecord jsr = new JavaStringRecord();
jsr.setEncoding("IBM-1047");
// Setup the interactionSpec.
ECIInteractionSpec eSpec = new ECIInteractionSpec();
eSpec.setCommareaLength(20);
eSpec.setReplyLength(20);
eSpec.setFunctionName("EC01");
eSpec.setInteractionVerb(ECIInteractionSpec.SYNC_SEND_RECEIVE);
eciInt.execute(eSpec, jsr, jsr);
response.getWriter().println(jsr.getText().trim());
} catch (Exception e){
throw new IOException(e);
}
response.flushBuffer();
}
示例2: handle
import javax.resource.cci.Interaction; //导入方法依赖的package包/类
@Override
public Message handle(Exchange exchange, Connection conn, Interaction interact) throws Exception {
StreamableRecord record = new StreamableRecord();
StreamableRecord outRecord = new StreamableRecord();
interact.execute(getInteractionSpec(), getMessageComposer(StreamableRecordBindingData.class).decompose(exchange, new StreamableRecordBindingData(record)).getRecord(), outRecord);
return _composer.compose(new StreamableRecordBindingData(outRecord), exchange);
}
示例3: handle
import javax.resource.cci.Interaction; //导入方法依赖的package包/类
@Override
public Message handle(Exchange exchange, Connection conn, Interaction interact) throws Exception {
MappedRecord record = getRecordFactory().createMappedRecord(MappedRecordHandler.class.getName());
MappedRecord outRecord = (MappedRecord) interact.execute(getInteractionSpec(), getMessageComposer(MappedRecordBindingData.class).decompose(exchange, new MappedRecordBindingData(record)).getRecord());
return _composer.compose(new MappedRecordBindingData(outRecord), exchange);
}
示例4: handle
import javax.resource.cci.Interaction; //导入方法依赖的package包/类
@Override
public Message handle(Exchange exchange, Connection conn, Interaction interact) throws Exception {
IndexedRecord record = getRecordFactory().createIndexedRecord(IndexedRecordHandler.class.getName());
IndexedRecord outRecord = (IndexedRecord) interact.execute(getInteractionSpec(), getMessageComposer(IndexedRecordBindingData.class).decompose(exchange, new IndexedRecordBindingData(record)).getRecord());
return _composer.compose(new IndexedRecordBindingData(outRecord), exchange);
}