JCA Interaction Spec and Connection Spec dynamic properties

The SCA EIS Binding can accept input for the InteractionSpec and ConnectionSpec specified by using a well defined child Data Object that accompanies the payload. This allows for dynamic request-response interactions with a resource adapter through the InteractionSpec and component authentication through the ConnectionSpec.

The javax.cci.InteractionSpec carries information on how the interaction request with the resource adapter should be handled. It can also carry information on how the interaction was achieved after the request. These two-way communications through the interactions are sometimes referred to as conversations.

The SCA EIS Binding expects the payload that will be the argument to the resource adapter to contain a child data object called "properties". This property Data Object will contain name/value pairs, with the name of the Interaction Spec properties in a specific format. The formatting rules are:
  1. Names must begin with the prefix "IS", followed by the property name. For example, an interaction spec with a Java Bean property called InteractionId, would specify the property name as ISInteractionId.
  2. The name/value pair represents the name and the value of the simple type of the Interaction Spec property.
There is an interface with the input of the operation being an "Account" Data Object. This interface invokes an EIS Import Binding service with the intention to send and receive dynamic InteractionSpec property called "workingSet" with value "xyz". One caveat that you can take advantage of is that the Business Graph or Business Objects in WebSphere Process Server contains an underlying "properties" Business Object that permits the sending of protocol-specific data with the payload. This properties Business Object is built-in, and does not need to be specified in the XML schema when constructing a business object. It only needs to be created and used. If you have your own data types defined based on XML Schema then you will need to specify a "properties" element that contains your expected name/value pairs.
 BOFactory dataFactory = (BOFactory) \
 serviceManager.locateService("com/ibm/websphere/bo/BOFactory");
  //Wrapper for doc-lit wrapped stle interfaces,
  //skip to payload for non doc-lit
  DataObject docLitWrapper = dataFactory.createByElement /
  ("http://mytest/eis/Account", "AccountWrapper");
Create the payload.
DataObject account = docLitWrapper.createDataObject(0);
  DataObject accountInfo = account.createDataObject("AccountInfo");
  //Perform your setting up of payload


  //Construct properties data for dynamic interaction
  
  DataObject properties = account.createDataObject("properties");
For name "workingSet", set the value expected "xyz".
properties.setString("ISworkingSet", "xyz");


  //Invoke the service with argument

  Service accountImport = (Service) \
  serviceManager.locateService("AccountOutbound");
  DataObject result = accountImport.invoke("createAccount", docLitWrapper);               

  //Get returned property
  DataObject retProperties = result.getDataObject("properties");

  String workingset = retProperties.getString("ISworkingSet");
You can use ConnectionSpec properties for dynamic component authentication. The same rules apply as above, except that the property name prefix needs to be "CS" (instead of "IS"). ConnectionSpec properties are not two-way. The same "properties" Data Object can contain both IS and CS properties. To utilize ConnectionSpec properties the resAuth specified on the import binding should be "Application", and the resource adapter must support component authorization. See chapter 8 of the J2EE Connector Architecture Specification for more details.

Last updated: Wed 06 Dec 2006 07:08:08

(c) Copyright IBM Corporation 2005, 2006.
This information center is powered by Eclipse technology (http://www.eclipse.org)