EJB Access Bean chaining outside a Web container

When EJB Access Beans are processed outside of a Web container (for example, directly from a Java program), the calling program must retrieve the values of the hPubAccessHandle and hPubLinkKey properties. The properties can be retrieved after the EJB Access Bean for the first Integration Object in the chain is processed. The calling program must set the two properties for all subsequent EJB Access Beans in the Integration Object chain before they are processed.

To chain EJB Access Beans outside of a Web container, do the following:

  1. Create an instance of the first EJB Access Bean in the chain by calling its constructor.
  2. Invoke the setter methods for the EJB Access Bean instance to set properties of input variables. The naming convention for setter methods is as follows:
    EJBChain1.setXyz(String)
    where Xyz is the name of your input variable.
  3. Invoke the EJB Access Bean to perform its task, for example running a macro, using the method:
    EJBChain1.processRequest()
  4. Check for errors by invoking:
    EJBChain1.getHPubErrorOccurred()
  5. Extract and save the key that represents the connection for the EJB Access Bean chain:
    String myLinkkey = EJBChain1.getHPubLinkKey();
  6. Extract and save the handle for the ZIETrans EJB instance corresponding to the Integration Object chain:
    Object myHandle = EJBChain1.getHPubAccessHandle();
  7. Create an instance of the next EJB Access Bean in the chain by calling its constructor.
  8. Set the key for this chained connection:
    EJBChain2.setHPubLinkKey(myLinkkey);
  9. Set the handle for this chained connection:
    EJBChain2.setHPubAccessHandle(myHandle);
  10. Invoke the methods for this EJB Access Bean instance. You might want to invoke methods to set properties of input variables. The naming convention for setter methods is as follows:
    EJBChain2.setXyz(String)
    where Xyz is the name of your input variable.
  11. Invoke this EJB Access Bean to perform its task (running a macro or querying a database, for example), using the method:
    EJBChain2.processRequest()
  12. Check for errors by invoking:
    EJBChain2.getHPubErrorOccurred()

Repeat steps 7 through 12 for any and all subsequent EJB Access Beans in the chain.