Program lifecycle

When a Java™ EE application is installed into Liberty, the cicsts:link-1.0 feature searches for methods annotated with @CICSProgram. For each one, it dynamically installs a PROGRAM resource. If a Java EE application is installed into Liberty using a CICS® bundle, the PROGRAM resources are created when the bundle is enabled. Otherwise, PROGRAM resources are created when Liberty installs the application.

When an application is removed, CICS deletes any dynamically installed PROGRAM resources associated with that application. If the application was installed using a CICS bundle, CICS deletes the programs when the bundle is disabled. If an application is removed while tasks invoking the application are still in progress, errors might occur. Therefore, disable any PROGRAM resources associated with a Java EE application and allow work to drain before removing the application. Otherwise, programs are deleted when Liberty uninstalls the application.

In most cases, you do not need to create your own PROGRAM definition. You might want to create your own PROGRAM definition if you do not want CICS to create one for you automatically, or if you want to specify particular attributes. To create a private program as part of a CICS application deployed on a platform, you must define it in a CICS bundle installed as part of that application. You can create a program definition in the CSD, BAS or in a CICS bundle, and install it yourself. When CICS finds a method that is annotated with @CICSProgram and a matching PROGRAM resource is already installed, CICS does not replace it.

When you are creating your program definition, you must specify the same classname as the class that contains the method annotated with @CICSProgram. You can optionally specify the method name as well. CICS validates this information when the program is invoked. The JVMCLASS attribute should contain the classname and optionally the method name in the format wlp:classname#methodname, for example:
wlp:com.example.CustomerLinkTarget#getCustomer