- All Superinterfaces:
- Serializable
- See Also:
- Top Examples, Source Code,
Interaction
public static final int SYNC_RECEIVE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int SYNC_SEND
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int SYNC_SEND_RECEIVE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[69]Call a BEA Tuxedo service
By Anonymous on 2002/10/09 18:09:11 Rate
/client code interacting with a Connection instance to
//call a BEA Tuxedo service:
// cx represents a previously acquired Connection instance
// cxf represents previously acquired ConnectionFactory instance
// first get a LocalTransaction instance
LocalTransaction ltx = cx.getLocalTransaction ( ) ;
// mark the beginning of a BEA Tuxedo transaction
ltx.begin ( ) ;
// get an Interaction instance
Interaction iact = cx.createInteraction ( ) ;
// create a new InteractionSpec object
TuxInteractionSpec tux1 = new TuxInteractionSpec;
// set the properties of the InteractionSpec instance
// note that InteractionVerb defaults to SYNC_SEND_RECEIVE,
// so the second line below isn't really necessary
tux1.setFunctionName ( "TUXServiceName" ) ;
tux1.setInteractionVerb ( SYNC_SEND_RECEIVE ) ;
tux1.setExecutionTimeout ( 1000 ) ;
// get a RecordFactory instance RecordFactory
rcf = cxf.getRecordFactory ( )
// create a Record Instance to hold input data
FMLRecord rc = ( FMLRecord ) rcf.createMappedRecord ( "FML" ) ;
// Populate Record instance with data
rc.addIn ( "FirstField", "value1" ) ;
rc.addIn ( "FirstField", "value2" ) ;
rc.addIn ( "FirstField", "value3" ) ;
rc.addIn ( "SecondField", "anothervalue" ) ;
// and so forth
// call the TUXEDO service
MappedRecord ret = iact.execute ( tux1, rc ) ;
// call other services in the transaction by creating
// new InteractionSpec instances and input records
// and calling execute as needed
// mark the end of the TUXEDO transaction
ltx.commit ( ) ;
//close the InteractionInstance
iact.close ( ) ;