II. The server processing the request and afterwards calling back the client

Class EasyResponderImpl implements the revertString() method: after calculating the return value, it uses ResponderUtil to call the client back.


import alma.ACS.CBDescIn;
import alma.ACS.CBstring;
import alma.acs.component.ComponentImplBase;
import alma.acs.callbacks.ResponderUtil;

import alma.mysubsystem.ResponderOperations;


public class EasyResponderImpl extends ComponentImplBase implements ResponderOperations {


  public void revertString (String text, CBstring cb, CBDescIn descIn)  {

      try {

         // --- calculate returnvalue

         int length = text.length();
         char[] res = new char[length];
         for (int i=0; i<length; res[i] = text.charAt(length-1-i++));
         String returnValue = new String(res);

  
         // --- invoke callback
         
         ResponderUtil.respond (returnValue, cb, descIn);


      } catch (Exception exc) {
     
         ResponderUtil.respond (exc, cb, descIn);
      }
  
  }
 
}