Previous Topic Next topic Print topic


Sample Custom Record

The above example uses the group record Calculator in the COBOL service, myservice.add. In the resource adapter CCI, this group record is expressed as a custom record. The following code is the custom record class, Calculator.java, corresponding to the group record:

/*******************************************************
This is a file generated by Micro Focus Net Express 4.0
This file represents the Custom Class for Calculator
*******************************************************/

public class Calculator extends 
      com.microfocus.cobol.connector.cci.CustomRecord {

   private java.math.BigDecimal arg1 = 
           java.math.BigDecimal.valueOf(0);
   private java.math.BigDecimal arg2 = 
           java.math.BigDecimal.valueOf(0);
   private java.math.BigDecimal result = 
           java.math.BigDecimal.valueOf(0);
   private java.math.BigDecimal storage = 
           java.math.BigDecimal.valueOf(0);
   public Calculator() {
   }
   public java.math.BigDecimal getArg1() {
       return arg1;
   }
   public void setArg1(java.math.BigDecimal ___p) {
       arg1 = ___p ;
   }
   public java.math.BigDecimal getArg2() {
       return arg2;
   }
   public void setArg2(java.math.BigDecimal ___p) {
       arg2 = ___p ;
   }
   public java.math.BigDecimal getResult() {
       return result;
   }
   public void setResult(java.math.BigDecimal ___p) {
       result = ___p ;
   }
   public java.math.BigDecimal getStorage() {
       return storage;
   }
   public void setStorage(java.math.BigDecimal ___p) {
       storage = ___p ;
   }
   public Object[] getParameters() {
       Object[] objs = new Object[4];
       objs[0] = arg1;
       objs[1] = arg2;
       objs[2] = result;
       objs[3] = storage;
       return objs;
   }
   public void setParameters(Object[] objs) {
       arg1 = (java.math.BigDecimal)objs[0];
       arg2 = (java.math.BigDecimal)objs[1];
       result = (java.math.BigDecimal)objs[2];
       storage = (java.math.BigDecimal)objs[3];
   }
}
Previous Topic Next topic Print topic