In some cases, you might find that the options in the sample JVM
profiles and JVM properties files need to be changed to fit the needs of a
particular application, or of your CICS region.
JVM profiles (JVMPROFILE attribute) gives an overview of the options that
are available for you to change in the JVM profiles and JVM properties files. Note that
if any changes are required to fit with the setup of your CICS region (for
example, if you are required to enable Java 2 security), you need to make
the same changes to the supplied sample JVM profiles DFHJVMPR and DFHJVMCD
and their associated JVM properties files. DFHJVMPR is used if a Java program
is defined as using a JVM but no JVM profile is specified, and it is used
for sample programs. DFHJVMCD is used by CICS-supplied system programs, including
the default request processor program (DFJIIRP) and the program that CICS
uses to publish and retract deployed JAR files (DFJIIRQ, the CICS-key equivalent
of DFJIIRP). Both these JVM profiles therefore need to be configured so that
they can be used in your CICS region.
Among other things, you might want to make the following changes:
- Enable Java 2 security for the JVM. The Java
2 security policy mechanism protects Java applications running in a JVM, and
particularly enterprise beans, from performing a potentially unsafe action.
You can enable Java 2 security by changing the JVM properties file to name
a security manager (using the java.security.manager system property),
and to state the location of one or more security policy files that the security
manager will use to determine the security policy for the JVM (using the java.security.policy system
property). The CICS-supplied sample JVM properties files do not enable
Java 2 security. Protecting Java applications in CICS by using the Java 2 security policy mechanism tells you what
changes you need to make to the sample JVM properties files to enable Java
2 security, how to set up a security policy file, and about the CICS-supplied
sample security policy file dfjejbpl.policy, which defines
security properties that are suitable for JVMs that are used by enterprise
beans.
- Change the amount of storage available
for the application's use, by changing the size of the middleware and transient
storage heaps in the JVM (using the Xmx= option in the JVM profile).
The value specified in the supplied sample JVM profiles is usually 32M, which
should be adequate for most purposes. If you have large Java applications,
you might want to increase this value. The CICS® Performance
Guide has more information about the storage-related JVM options,
and how to determine suitable values for them.
- Change the destination for messages from JVM internals
and for output from Java applications running in the JVM (using the USEROUTPUTCLASS= option
in the JVM profile). Redirecting JVM output tells you more
about this option.
- Change your
work directory (using the WORK_DIR= option in the JVM profile). This
HFS directory is used for the stdin, stdout and stderr files
for JVMs. The default is the user directory of the CICS region user ID. If
you are not using the USEROUTPUTCLASS= option to redirect the output
from your JVMs elsewhere, you might want to change the work directory to a
location that is more convenient for you.
- Set up the JDBC drivers
supplied by DB2, and also the DataSource interface, so that your Java applications
can access DB2 data. “Using JDBC and SQLJ to access DB2 data from Java programs and
enterprise beans written for CICS” in the CICS DB2® Guide explains how you can
do this.You need to use various options in the JVM profile and JVM properties
file, which are described in that topic.
- Enable or disable assertion checking at
runtime. An assertion is a statement in the Java programming language that
enables you to test your assumptions about your program. Using the ENABLEASSERTIONS, DISABLEASSERTIONS and SYSTEMASSERTIONS options
in the JVM profile, you can enable or disable assertion checking for system
classes, all application classes, a package, or an individual class. You can
find more information about programming with assertions at http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.dital.
- For CORBA stateless objects and enterprise beans, specify the information
that is necessary to configure the name server to be used for JNDI references
(using the com.ibm.cics.ejs.nameserver system property), and further
information that is necessary if you are using an LDAP name server. The procedures
described in Configuring CICS for IIOP tell you how to do
this.
Note: In some previous versions of CICS, you could use the -Xquickstart option
(specified using the Xservice option) in a JVM profile to
reduce the startup time for the JVM. However, with improvements in JVM technology,
the -Xquickstart option is now permanently enabled, and specifying -Xquickstart in
a JVM profile has no effect.
For further information, the CICS System Definition Guide has the full
lists of options that you can specify using JVM profiles and JVM properties
files, and “The sample JVM profiles and JVM properties files” in the CICS System
Definition Guide gives the full text of the CICS-supplied sample
files.
If you want to change any of the options in the JVM profiles or JVM properties
files, you can either customize the CICS-supplied sample files, or create
your own JVM profiles or JVM properties files. Customizing or creating JVM profiles and JVM properties files tells
you how to do this.
If you do not want to change any of the options specified in the JVM profiles
or JVM properties files, and you have specific applications (standard Java
programs, CORBA stateless objects or enterprise beans) to run, Enabling applications to use a JVM tells
you how to set up applications to use a JVM profile, and how to add the classes
for the application to the class paths. If you are following a procedure to
set up IIOP support or support for enterprise beans, and you do not yet have
any specific applications to run, you can return to the procedure Setting up the host system for IIOP or Setting up an EJB server.