You can expose the properties of IMSInteractionSpec and IMSConnectionSpec
for input as data so that your Java application can set or get the property
values. For example, you may want to expose the userName and password properties
of IMSConnectionSpec if your Java application is using component-managed EIS
sign-on. Or, you may want to expose the clientID property of IMSConnectionSpec
if your Java application is executing an interaction on a dedicated persistent
socket connection.
To expose the properties of IMSInteractionSpec and IMSConnectionSpec
for input, you must modify the interface and implementation files of your
J2C Java bean before using it in an application. Typically, you expose only
the properties that your Java application needs as input. The steps in this
topic illustrate how to expose all the properties of IMSInteractionSpec and
IMSConnectionSpec using the J2C Java bean in the project
PhoneBookJ2CBean that
was created in the topic,
Creating a J2C Java bean.
To
expose all the properties of IMSInteractionSpec and IMSConnectionSpec for
input, complete the following steps:
- Expand the project, PhoneBookJ2CBean, and
open the interface file PB.java in the Java editor.
- In the PB.java file, update the method runPB(). Add the arguments for the input properties of IMSInteractionSpec and
IMSConnectionSpec. These arguments are used to provide input values for the
exposed properties, in the same way the argument INPUTMSGarg is used
to provide values for the input message of the IMS transaction. After you
add the arguments in the method runPB(), the code looks like the following:
package sample.ims;
/**
* @generated
*/
public interface PB {
/**
* @generated
*/
public OUTPUTMSG runPB(INPUTMSG arg,
int myCommitMode,
int myExecutionTimeout,
int myImsRequestType,
int myInteractionVerb,
String myLtermName,
String myMapName,
boolean myPurgeAsyncOutput,
boolean myReRoute,
String myReRouteName,
int mySocketTimeout,
String myUserName,
String myPassword,
String myGroupName,
String myClientID) throws javax.resource.ResourceException;
}
- Save and close the file.
- Expand the project PhoneBookJ2CBean and
open the binding file, PBImpl.java in the Java editor.
- In the PBImpl.java file, update the javadoc for method runPB() by
adding doclet tags for each of the properties that you wish to expose.
- Update the signature of method runPB(). Add the arguments
for the implementation. The arguments added to the method are referenced
by the corresponding doclet tags. For information about editing J2C doclet
tags, see Editing the J2C Java bean. After you add
the doclet tags and update the signature of the method, the code looks like
the following:
/**
* @j2c.interactionSpec class="com.ibm.connector2.ims.ico.IMSInteractionSpec"
* @j2c.interactionSpec-property name="commitMode" argumentBinding="myCommitMode"
* @j2c.interactionSpec-property name="executionTimeout" argumentBinding="myExecutionTimeout"
* @j2c.interactionSpec-property name="imsRequestType" argumentBinding="myImsRequestType"
* @j2c.interactionSpec-property name="interactionVerb" argumentBinding="myInteractionVerb"
* @j2c.interactionSpec-property name="ltermName" argumentBinding="myLtermName"
* @j2c.interactionSpec-property name="mapName" argumentBinding="myMapName"
* @j2c.interactionSpec-property name="purgeAsyncOutput" argumentBinding="myPurgeAsyncOutput"
* @j2c.interactionSpec-property name="reRoute" argumentBinding="myReRoute"
* @j2c.interactionSpec-property name="reRouteName" argumentBinding="myReRouteName"
* @j2c.interactionSpec-property name="socketTimeout" argumentBinding="mySocketTimeout"
*
* @j2c.connectionSpec class="com.ibm.connector2.ims.ico.IMSConnectionSpec"
* @j2c.connectionSpec-property name="userName" argumentBinding="myUserName"
* @j2c.connectionSpec-property name="password" argumentBinding="myPassword"
* @j2c.connectionSpec-property name="groupName" argumentBinding="myGroupName"
* @j2c.connectionSpec-property name="clientID" argumentBinding="myClientID"
*
* @generated
*/
public OUTPUTMSG runPB(INPUTMSG arg,
int myCommitMode,
int myExecutionTimeout,
int myImsRequestType,
int myInteractionVerb,
String myLtermName,
String myMapName,
boolean myPurgeAsyncOutput,
boolean myReRoute,
String myReRouteName,
int mySocketTimeout,
String myUserName,
String myPassword,
String myGroupName,
String myClientID) throws javax.resource.ResourceException {
- Save and close the file. The new implementation
code is generated for method runPB().
For each exposed property, the doclet tag uses the argumentBinding attribute
instead of the value attribute. The value of the argumentBinding attribute
represents the method argument of the corresponding IMSInteractionSpec or
IMSConnectionSpec property. You have now exposed all the IMSConnectionSpec
properties for input.