CICS ABENDs and exceptions are integrated into the Java exception-handling
architecture. All regular CICS ABENDs are mapped to a single Java exception, AbendException, whereas each CICS condition is mapped to a separate
Java exception.
This leads to an ABEND-handling model in Java that is similar to the other
programming languages; a single handler is given control for every ABEND,
and the handler has to query the particular ABEND and then decide what to
do.
If the exception representing a condition is caught by CICS itself, it
is turned into an ABEND.
Java exception-handling is fully integrated with the ABEND and condition-handling
in other languages, so that ABENDs can propagate between Java and non-Java
programs, in the standard language-independent way. A condition is mapped
to an ABEND before it leaves the program that caused or detected the condition.
However, there are several differences to the abend-handling model for
other programming languages, resulting from the nature of the Java exception-handling
architecture and the implementation of some of the technology underlying the
Java API:
- ABENDs that are considered unhandleable in other programming languages
can be caught in Java programs. These ABENDs typically occur during SYNCPOINT
processing. To avoid these ABENDs interrupting Java applications, they are
mapped to an extension of an unchecked exception; therefore they do not have
to be declared or caught.
- Several internal CICS events, such as program termination, are also mapped
to Java exceptions and can therefore be caught by a Java application. Again,
to avoid interrupting the normal case, these are mapped to extensions of an
unchecked exception and so do not have to be caught or declared.
Note: CICS requires the Language Environment® product to be installed and active on your OS/390® system in order to run Java applications.
You should not specify the Language Environment run-time option TRAP=OFF,
because this will disable abend handling in JCICS.
There are three CICS-related class hierarchies of exceptions:
- CicsError, which extends java.lang.Error and is
the base for AbendError and UnknownCicsError.
- CicsRuntimeException, which extends java.lang.RuntimeException and is in turn extended by:
- AbendException
- Represents a normal CICS ABEND.
- EndOfProgramException
- Indicates that a linked-to program has terminated normally.
- TransferOfControlException
- Indicates that a program has used an xctl() method, the equivalent
of the CICS XCTL command.
- CicsException, which extends java.lang.Exception and
has the subclass:
- CicsConditionException.
- The base class for all CICS conditions.