Monday, 3 January 2011

How to Simulate Mainframe Transaction Server Screen Processing with JAVA and UNIX.

Please refer to my previous article on transaction activation which includes a working simple prototype with JAVA.

After the transaction program is activated it does some initiation etc. and it tries to get data from the user. The mainframe does this with a CICS or Natural - ADABAS call. It displays a data and recieves back the data entered by the user.

The problem here is:
1. The JAVA program has to initiate a JSP program at the right point of its own flow.

2. It should stop while the user enters the data to the JSP.
3. The JSP should tell the JAVA program to go ahead and get the results.
4. The JAVA program should continue processing and now the JSP should wait.

As seen, there are two threads here. One HTTP thread and one library thread. In fact this library thread has been initiated by an activator JSP which in turn has been called from the logon JSP.

The activator JSP starts the JAVA transaction program and issues lock.wait() for its own lock. The JAVA program begins to work and continues till the screen input. There it issues a libLock.wait() and lock.notify() s and frees the previous JSP. But before it does so it sets the name of the next screen. When the previous JSP is
notified it finishes its own job and activates the next screen.

During this wait and notify process the input is taken and written to certain locations in the library.

My next simulation will be a protype of this wait and notify process. After that there will be a theoreticaltext on the details of input handling which will be succeeded by a relevant working prototype.

Regards.