Programming Exits for iWay Service Manager

In this section:

iWay Service Manager must be able to run on any platform. Normally, this is a simple Java concern. However, some platforms, such as IBM Open Edition under MVS run in a different code page (1049) than the standard ASCII code page. If an exit or business agent must read or write a byte stream, it should use the appropriate encoding version of the methods used. This issue applies to all exits and business agents, but is especially true in encryption exits, which must deal with raw bytes unassociated with code pages.

Init() and term() methods in all exits run synchronized, however, the execute() and transform() methods may run under multiple threads; it must be reentrant as a general rule. Any global data can be initialized only in the init() routine, and unless your code locks the variables it cannot be changed in the execute() or transform() routines at the risk of memory read failures. Such failures can be hard to debug, but are usually evidenced by the reentrant method receiving unexpected data from the global area as other threads change the values. Do not depend upon the init() routine being called only once. The engine may elect to roll out your exit during periods of peak use and reinstate it later.

When exits are configured, the parameters under which the business agent runs are taken first from the local definition and, if there are no parameters, from the deployed class as specified in the DEFINE section of the configurator. If your document is configured to use a business agent named myagent with parms a,b,c, then those are the parms that are used. In turn, myagent can be deployed as an alias for com.xyz.agentcode(d,e,f), which is the real class and default parameter. So, for our example, com.xyz.agentcode(a,b,c) is called. If myagent had been specified in the document with no parameters, then com.xyz.agentcode(d,e,f) is called.


Top of page

x
Overall Guidelines

When coding any iWay Service Manager exit or adapter, you must adhere to these guidelines:


iWay Software