Exposing InteractionSpec and ConnectionSpec properties for input as data

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:

  1. Expand the project, PhoneBookJ2CBean, and open the interface file PB.java in the Java editor.
  2. 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; 
    }
    
  3. Save and close the file.
  4. Expand the project PhoneBookJ2CBean and open the binding file, PBImpl.java in the Java editor.
  5. 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.
  6. 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 {
  7. 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.
Related tasks
Creating IMS Java data bindings
Creating a J2C Java bean
Exposing InteractionSpec output properties as data
Creating a web page, web service, or EJB from a J2C Java bean
Using IMS data bindings in a CCI application
Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.