Java restrictions

When developing Java™ applications for CICS®, there are a number of restrictions a programmer should be aware of.

The following restrictions apply for Java applications used in CICS :

  • Do not use the System.exit() method. Using this method when the application is running in a JVM server will terminate the JVM server, quiesce CICS, and may lead to data inconsistency. Use a Java security policy to prohibit use of System.exit(). For related information see Enabling a Java security manager.
  • JCICS API calls: these calls cannot be used in the activator classes of OSGi bundles.
    Note: The Java thread that runs the OSGi bundle activator will not be JCICS-enabled. A developer can start a new JCICS-enabled thread from an activator, by using the CICSExecutorService.runAsCICS() API. Any JCICS commands will run under the authority of the user id that issued the install command. Therefore it is prudent for an administrator to understand the resources used in OSGi bundle activators before they install them. There is more information on the runAsCICS() API at Threads and tasks example.
  • Start and stop methods used in OSGi bundle activators: these methods must return in a reasonable amount of time.
  • Do not share JCICS objects between threads. You can only call instance methods on JCICS objects from the thread that created them.
  • Do not use finalizers in CICS Java programs. For an explanation of why finalizers are not recommended, see IBM SDK for z/OS, Java Technology Edition, Version 7, Troubleshooting and support section.