Startup, Operation and Shutdown of a Java Instance

Purpose

With the Java startup and control framework you can start, monitor, and stop a Java instance. This means you can:

·        Restart processes

·        Send request to shut instance down

·        Terminate hanging processes

The program JControl is part of the standard delivery.

Process Flow

The following figure shows the flow of the actions that the Java startup and control framework executes.

Startup of the Java Instance

The following steps are involved in starting the Java instance:

·        JControl is started (in Windows by the SAP start service; on UNIX platforms by the startsap script).

·        JControl initializes the SAP signal handling to be able to handle signals received.

·        JControl starts JLaunch with the bootstrap.properties file (1). This executes the following steps:

Ў        The first argument of JLaunch is the PID of the parent process (JControl). JLaunch starts a thread, which ends the JLaunch process, if the parent process, JControl, fails.

Ў        Creates Java Virtual Machine (JVM) arguments and initializes hosting of the virtual machine (VM).

Ў        Loads the VM into its own process, initializes the VM and starts the bootstrap program.

Ў        The bootstrap program synchronizes the binary data of the Java database with the local file system (2).

Ў        The bootstrap program reads the Java instance description from the Java database and writes the file instance.properties (3). The file instance.properties contains the description and the arguments of the AS Java cluster elements that are to be started. 

·        JControl reads and creates a list of the AS Java cluster elements to be started (4).

·        JControl starts a JLaunch process for each cluster element (5). This executes the following steps:

Ў        The first argument of JLaunch is the PID of the parent process (JControl). JLaunch starts a thread, which ends the JLaunch process, if the parent process, JControl, fails.

Ў        Creates JVM arguments and initializes hosting of the VM.

Ў        Loads the VM into its own process, initializes the VM and starts the Java cluster element. This executes the following steps:

§         Starts the “offline“ configuration manager to read the properties for the Java Enterprise runtime from the database and to save them in various hash tables (6).

§         Stops the “offline“ configuration manager and starts the Java Enterprise runtime with the saved properties.

§         Starts the service framework and the services.

See also:

J2EE Engine System Architecture

Operation of the Java Instance

The JControl process monitors the Java instance. It continuously checks the status of the cluster elements of the instance and restarts terminated processes.

Shutdown of the Java Instance

Signals and named pipes trigger a Java instance to stop. The process ensures that following a shutdown time interval all cluster elements of the instance are exited.

The figure below shows the communication.

An instance is stopped as follows:

·        The SAP start/stop environment (start script or SAP Start Service on Windows), which started the JControl process, sends a SIGINT to the JControl process (1).

·        JControl sets the status of the Java instance to STOPPING in its list and sends a notification using a named pipe to all of the running cluster elements (2).

·        The JLaunch process of the Java cluster element must respond to the notification within a defined time interval. (If this soft shutdown does not work, the JLaunch process is completely terminated by JControl.) It triggers the shutdown of the AS Java cluster element in the JVM and waits for its own VM to terminate (3).

·        JControl exits.